Show Dia in its own dynamic tag

This commit is contained in:
Tom Willemse 2015-02-26 00:02:33 +01:00
parent 72bba12f10
commit 9a4c2b5ea8

View file

@ -511,6 +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})
awful.tag.viewonly(tags["Dia"])
awful.client.movetotag(tags["Dia"], c)
awful.tag.setmwfact(0.90, tags["Dia"])
end
-- Put windows in a smart way, only if they does not set an initial position.
if not c.size_hints.user_position and not c.size_hints.program_position then
awful.placement.no_overlap(c)
@ -519,6 +527,15 @@ client.connect_signal("manage", function (c, startup)
end
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
end
end
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}