Also dynamically create a tag for Firefox

This commit is contained in:
Tom Willemse 2015-02-26 00:36:12 +01:00
parent 9a4c2b5ea8
commit cd7bdc03cf

View file

@ -511,11 +511,14 @@ client.connect_signal("manage", function (c, startup)
awful.client.setslave(c) awful.client.setslave(c)
end end
if awful.rules.match(c, { class = "Dia" }) then if awful.rules.match_any(c, { class = { "Dia", "Firefox" } }) then
tags["Dia"] = tags["Dia"] or awful.tag.add("Dia", {layout = awful.layout.suit.tile}) tags[c.class] = tags[c.class] or
awful.tag.add(c.class, {layout = awful.layout.suit.tile})
awful.tag.viewonly(tags[c.class])
awful.client.movetotag(tags[c.class], c)
end
awful.tag.viewonly(tags["Dia"]) if awful.rules.match(c, { class = "Dia" }) then
awful.client.movetotag(tags["Dia"], c)
awful.tag.setmwfact(0.90, tags["Dia"]) awful.tag.setmwfact(0.90, tags["Dia"])
end end
@ -528,10 +531,10 @@ client.connect_signal("manage", function (c, startup)
end) end)
client.connect_signal("unmanage", function(c) client.connect_signal("unmanage", function(c)
if awful.rules.match(c, { class = "Dia" }) then if awful.rules.match_any(c, { class = { "Dia", "Firefox" } }) then
if #tags["Dia"]:clients() == 0 then if tags[c.class] and #tags[c.class]:clients() == 0 then
awful.tag.delete(tags["Dia"]) awful.tag.delete(tags[c.class])
tags["Dia"] = nil tags[c.class] = nil
end end
end end
end) end)