From d121d943660a6ad2cd2ca88585091ed75c45acfc Mon Sep 17 00:00:00 2001 From: "Ignas Anikevicius (gns_ank)" Date: Fri, 4 May 2012 22:51:09 +0100 Subject: [PATCH] Menubar: Match for command names as well. Enabling matching the command name of the menubar entries with the query, which improves the flexibility of the widget. The functionality works as follows: You want to run GIMP, which has a name of "GNU Image Manipulation Program". Previously by typing in gimp one would have , but now it will match GIMP entry. Signed-off-by: Ignas Anikevicius (gns_ank) Signed-off-by: Uli Schlachter --- lib/menubar/init.lua.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/menubar/init.lua.in b/lib/menubar/init.lua.in index 43647bc7..3e96c30b 100644 --- a/lib/menubar/init.lua.in +++ b/lib/menubar/init.lua.in @@ -136,12 +136,14 @@ local function menulist_update(query) end end - -- Add the applications + -- Add the applications according to their name and cmdline for i, v in ipairs(menu_entries) do v.focused = false if not current_category or v.category == current_category then - if string.match(v.name, nocase(query)) then - if string.match(v.name, "^" .. nocase(query)) then + if string.match(v.name, nocase(query)) + or string.match(v.cmdline, nocase(query)) then + if string.match(v.name, "^" .. nocase(query)) + or string.match(v.cmdline, "^" .. nocase(query)) then table.insert(shownitems, v) else table.insert(match_inside, v)