Merge branch 'master' of ssh://tsimri.wsr.ac.at/home/hjp/wrk/xfce-xterm-launcher-update

This commit is contained in:
Peter J. Holzer 2017-06-17 12:37:01 +02:00
commit bcab6770c3
2 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ my $launcher = $ARGV[0];
my $launcher_dir = "$ENV{HOME}/.config/xfce4/panel/launcher-$launcher"; my $launcher_dir = "$ENV{HOME}/.config/xfce4/panel/launcher-$launcher";
my @desktop_files = glob("$launcher_dir/*.desktop"); my @desktop_files = glob("$launcher_dir/*.desktop");
mkdir "$ENV{HOME}/log/";
mkdir "$ENV{HOME}/log/xfce-xterm-launcher/"; mkdir "$ENV{HOME}/log/xfce-xterm-launcher/";
open my $log, ">>", "$ENV{HOME}/log/xfce-xterm-launcher/" . strftime("%Y-%m", localtime); open my $log, ">>", "$ENV{HOME}/log/xfce-xterm-launcher/" . strftime("%Y-%m", localtime);

View File

@ -1,5 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
use v5.24; # for postderef
use warnings; use warnings;
use strict; use strict;
use File::Slurp; use File::Slurp;
@ -23,7 +24,7 @@ for (@desktop_files) {
my @xterm_scripts = glob("$ENV{HOME}/bin/hosts/*"); my @xterm_scripts = glob("$ENV{HOME}/bin/hosts/*");
@xterm_scripts = sort { -A $a <=> -A $b } @xterm_scripts; @xterm_scripts = sort { -A $a <=> -A $b } @xterm_scripts;
@xterm_scripts = @xterm_scripts[0..31]; @xterm_scripts = @xterm_scripts[0..31] if @xterm_scripts > 32;
for my $xterm_script (@xterm_scripts) { for my $xterm_script (@xterm_scripts) {
my ($name) = $xterm_script =~ m{([^/]+)$}; my ($name) = $xterm_script =~ m{([^/]+)$};
if ($desktop_files{$name}) { if ($desktop_files{$name}) {
@ -100,7 +101,7 @@ sub replace {
} }
open(my $fh, '>', $filename); open(my $fh, '>', $filename);
print $fh "[Desktop Entry]\n"; print $fh "[Desktop Entry]\n";
for my $k (sort keys $desktop_file->{content_fields}) { for my $k (sort keys $desktop_file->{content_fields}->%*) {
print $fh "$k=$desktop_file->{content_fields}{$k}\n"; print $fh "$k=$desktop_file->{content_fields}{$k}\n";
} }
close($fh); close($fh);