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