From cd7bdc03cf1bd3fc7493ae36b1eb9ec5af1e2ccd Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 26 Feb 2015 00:36:12 +0100 Subject: [PATCH] Also dynamically create a tag for Firefox --- awesome/.config/awesome/rc.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index ffca8d8..be44348 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -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)