start: when using xrun, also search for capitalized version of the name

Moreover, we use awful.rules.match_any to find clients.
This commit is contained in:
Vincent Bernat 2012-07-13 10:57:53 +02:00
parent b1eaaf7516
commit 4f8d580c8f
2 changed files with 11 additions and 8 deletions

View file

@ -56,12 +56,12 @@ xrun("polkit-gnome-authentication-agent-1",
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1") "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1")
xrun("Bluetooth Applet", xrun("Bluetooth Applet",
"bluetooth-applet") "bluetooth-applet")
xrun("Pidgin", "pidgin -n") xrun("pidgin", "pidgin -n")
xrun("emacs") xrun("emacs")
if config.hostname == "neo" then if config.hostname == "neo" then
xrun("keepassx", "keepassx -min -lock") xrun("keepassx", "keepassx -min -lock")
xrun("Transmission", "transmission-gtk -m") xrun("transmission", "transmission-gtk -m")
xrun("chromium") xrun("chromium")
elseif config.hostname == "guybrush" then elseif config.hostname == "guybrush" then
xrun("keepassx", "keepassx -min -lock") xrun("keepassx", "keepassx -min -lock")

View file

@ -4,13 +4,16 @@ local xrun_now = function(name, cmd)
-- Try first the list of clients from awesome (which is available -- Try first the list of clients from awesome (which is available
-- only if awesome has fully started, therefore, this function -- only if awesome has fully started, therefore, this function
-- should be run inside a 0 timer) -- should be run inside a 0 timer)
local clients = client.get() local squid = { name, name:sub(1,1):upper() .. name:sub(2) }
local client if awful.client.cycle(
for _, client in pairs(clients) do function(c)
if client.name == name or client.class == name or client.instance == name then return awful.rules.match_any(c,
{ name = squid,
class = squid,
instance = squid })
end)() then
return return
end end
end
-- Not found, let's check with xwininfo. We can only check name but -- Not found, let's check with xwininfo. We can only check name but
-- we can catch application without a window... -- we can catch application without a window...