i3-dmenu-desktop: run commands when they don’t match a .desktop file

This allows you to enter e.g. "i3 layout stacking" (provided you don’t
have an i3 .desktop file)
next
Michael Stapelberg 2013-03-21 23:32:46 +01:00
parent 505d87ef3e
commit 7552a02d5c
1 changed files with 7 additions and 1 deletions

View File

@ -346,7 +346,13 @@ if (exists($choices{$choice})) {
last;
}
if (!defined($app)) {
die "Invalid input: “$choice” does not match any application.";
warn "Invalid input: “$choice” does not match any application. Trying to execute nevertheless.";
$app->{Name} = '';
$app->{Exec} = $choice;
# We assume that the app is old and does not support startup
# notifications because it doesnt ship a desktop file.
$app->{StartupNotify} = 0;
$app->{_Location} = '';
}
}