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")
xrun("Bluetooth Applet",
"bluetooth-applet")
xrun("Pidgin", "pidgin -n")
xrun("pidgin", "pidgin -n")
xrun("emacs")
if config.hostname == "neo" then
xrun("keepassx", "keepassx -min -lock")
xrun("Transmission", "transmission-gtk -m")
xrun("transmission", "transmission-gtk -m")
xrun("chromium")
elseif config.hostname == "guybrush" then
xrun("keepassx", "keepassx -min -lock")

View file

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