diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-03-26 09:15:31 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-03-26 09:15:31 +0200 |
commit | d7607133e13621661a55efb65d6d20b02901ff40 (patch) | |
tree | e3aa41b07930d22446c0794059b235c4f5edc6cd | |
parent | 8d95cbea15ecca3fe14bf9c02a00f1c0d678ebb6 (diff) |
Use system-provided Oxygen icons instead of shipping them with the module
-rw-r--r-- | Build.PL | 1 | ||||
-rwxr-xr-x | lib/App/Dthumb.pm | 17 | ||||
-rw-r--r-- | share/folder-blue.png | bin | 3233 -> 0 bytes | |||
-rw-r--r-- | share/unknown.png | bin | 6873 -> 0 bytes |
4 files changed, 18 insertions, 0 deletions
@@ -23,6 +23,7 @@ my $build = Module::Build->new( 'autodie' => 0, 'Cwd' => 0, 'Data::Section' => 0, + 'File::Copy' => 0, 'Getopt::Long' => 0, 'Image::Imlib2' => 0, 'IO::Handle' => 0, diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm index a478c7d..0223016 100755 --- a/lib/App/Dthumb.pm +++ b/lib/App/Dthumb.pm @@ -6,6 +6,7 @@ use 5.010; use App::Dthumb::Data; use Cwd; +use File::Copy qw(copy); use File::Slurp qw(read_dir write_file); use Image::Imlib2; @@ -30,6 +31,8 @@ sub new { $conf{names} //= ( $conf{'no-names'} ? 0 : 1 ); + $conf{oxygen_base} //= '/usr/share/icons/oxygen/base'; + $ref->{config} = \%conf; $ref->{data} = App::Dthumb::Data->new(); @@ -90,6 +93,14 @@ sub create_files { my $thumbdir = $self->{config}->{dir_thumbs}; my $datadir = $self->{config}->{dir_data}; my @files = $self->{data}->list_archived; + my @icons; + + if ( $self->{config}{all} ) { + push( @icons, 'mimetypes/unknown.png' ); + } + if ( $self->{config}{recursive} ) { + push( @icons, 'places/folder-blue.png' ); + } for my $dir ( $thumbdir, $datadir, "${datadir}/css", "${datadir}/js" ) { if ( not -d $dir ) { @@ -101,6 +112,12 @@ sub create_files { write_file( "${datadir}/${file}", $self->{data}->get($file) ); } + for my $icon (@icons) { + my ( $dir, $file ) = split( qr{/}, $icon ); + my $base = $self->{config}{oxygen_base}; + copy( "${base}/128x128/${dir}/${file}", "${datadir}/${file}" ); + } + return; } diff --git a/share/folder-blue.png b/share/folder-blue.png Binary files differdeleted file mode 100644 index b083196..0000000 --- a/share/folder-blue.png +++ /dev/null diff --git a/share/unknown.png b/share/unknown.png Binary files differdeleted file mode 100644 index 50a2969..0000000 --- a/share/unknown.png +++ /dev/null |