From 7552a02d5ca5b46b985a89294126782b494e0ec0 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 21 Mar 2013 23:32:46 +0100 Subject: [PATCH] =?UTF-8?q?i3-dmenu-desktop:=20run=20commands=20when=20the?= =?UTF-8?q?y=20don=E2=80=99t=20match=20a=20.desktop=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows you to enter e.g. "i3 layout stacking" (provided you don’t have an i3 .desktop file) --- i3-dmenu-desktop | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index 65e99ec0..cf5b41e0 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -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 doesn’t ship a desktop file. + $app->{StartupNotify} = 0; + $app->{_Location} = ''; } }