line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::UserDirs; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
70987
|
use strict; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
5
|
1
|
|
|
1
|
|
639
|
use IPC::System::Simple qw(capturex); |
|
1
|
|
|
|
|
13439
|
|
|
1
|
|
|
|
|
68
|
|
6
|
1
|
|
|
1
|
|
8
|
use Exporter 5.57 qw( import ); |
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
307
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Find extra media and documents directories |
9
|
|
|
|
|
|
|
our $VERSION = '0.09'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
12
|
|
|
|
|
|
|
all => [ |
13
|
|
|
|
|
|
|
qw(xdg_desktop_dir xdg_documents_dir xdg_download_dir xdg_music_dir |
14
|
|
|
|
|
|
|
xdg_pictures_dir xdg_publicshare_dir xdg_templates_dir xdg_videos_dir) |
15
|
|
|
|
|
|
|
]); |
16
|
|
|
|
|
|
|
our @EXPORT_OK = @{$EXPORT_TAGS{all}}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _xdg_user_dir { |
20
|
0
|
|
|
0
|
|
|
my ($purpose) = @_; |
21
|
0
|
|
|
|
|
|
my $dir = capturex 'xdg-user-dir', $purpose; |
22
|
0
|
|
|
|
|
|
chomp $dir; |
23
|
0
|
|
|
|
|
|
return $dir; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
sub xdg_desktop_dir {return _xdg_user_dir 'DESKTOP';} |
27
|
0
|
|
|
0
|
1
|
|
sub xdg_documents_dir {return _xdg_user_dir 'DOCUMENTS';} |
28
|
0
|
|
|
0
|
1
|
|
sub xdg_download_dir {return _xdg_user_dir 'DOWNLOAD';} |
29
|
0
|
|
|
0
|
1
|
|
sub xdg_music_dir {return _xdg_user_dir 'MUSIC';} |
30
|
0
|
|
|
0
|
1
|
|
sub xdg_pictures_dir {return _xdg_user_dir 'PICTURES';} |
31
|
0
|
|
|
0
|
1
|
|
sub xdg_publicshare_dir {return _xdg_user_dir 'PUBLICSHARE';} |
32
|
0
|
|
|
0
|
1
|
|
sub xdg_templates_dir {return _xdg_user_dir 'TEMPLATES';} |
33
|
0
|
|
|
0
|
1
|
|
sub xdg_videos_dir {return _xdg_user_dir 'VIDEOS';} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |