From: Michael Stapelberg Date: Sat, 13 Jul 2013 15:47:10 +0000 (+0200) Subject: i3-dmenu-desktop: honor Path= key (Thanks Alexander) X-Git-Tag: 4.6~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=35aec2f03849a6238e4d216270b3ed9e9ef252a5;p=i3%2Fi3 i3-dmenu-desktop: honor Path= key (Thanks Alexander) fixes #1041 --- diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index cf5b41e0..cccc1dc5 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -45,7 +45,7 @@ my $result = GetOptions( 'dmenu=s' => \$dmenu_cmd, 'entry-type=s' => \@entry_types, 'version' => sub { - say "dmenu-desktop 1.4 © 2012-2013 Michael Stapelberg"; + say "dmenu-desktop 1.5 © 2012-2013 Michael Stapelberg"; exit 0; }, 'help' => sub { @@ -175,6 +175,7 @@ for my $file (values %desktops) { $names{$key} = $value; } elsif ($key eq 'Exec' || $key eq 'TryExec' || + $key eq 'Path' || $key eq 'Type') { $apps{$base}->{$key} = $value; } elsif ($key eq 'NoDisplay' || @@ -403,6 +404,10 @@ $exec =~ s/%k/$location/g; # Literal % characters are represented as %%. $exec =~ s/%%/%/g; +if (exists($app->{Path}) && $app->{Path} ne '') { + $exec = 'cd ' . $app->{Path} . ' && ' . $exec; +} + my $nosn = ''; my $cmd; if (exists($app->{Terminal}) && $app->{Terminal}) { @@ -507,7 +512,7 @@ command), and "libreoffice-writer" (type = filename). =head1 VERSION -Version 1.4 +Version 1.5 =head1 AUTHOR