diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-12-03 23:03:38 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-12-03 23:03:38 +0100 |
commit | 22eda10d0fc1c10279434e39b11ce565fbe79b2d (patch) | |
tree | becaf44c84a0018a249be1214efa4dc171f35b44 /rc.lua | |
parent | bdc6017ba2ce355fe4d14acdf7912da88c77ccf5 (diff) | |
download | awesome-configs-22eda10d0fc1c10279434e39b11ce565fbe79b2d.tar.xz |
rc.lua: use rule callback to remove titlebars selectively
Floating client that will NOT have a titlebar GETS one in callback. It
is removed in the manage signal. Rules are executed first, so we do it
like this, this is simpler than doing checks like: c.class ~=
"Xmessage" and c.class ~= ...
Arrange could seem like a better place to deal with the whole
floater-titlebar issue but it's not. It makes it impossible to remove
a titlebar, and causes some other side effects.
Diffstat (limited to 'rc.lua')
-rw-r--r-- | rc.lua | 27 |
1 files changed, 12 insertions, 15 deletions
@@ -472,15 +472,11 @@ for i = 1, keynumber do globalkeys = awful.util.table.join( globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) - end + if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) - end + if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then @@ -523,7 +519,8 @@ awful.rules.rules = { { rule = { class = "Emacs", instance = "_Remember_" }, properties = { floating = true } }, { rule = { class = "Xmessage", instance = "xmessage" }, - properties = { floating = true } }, + properties = { floating = true }, + callback = awful.titlebar.add }, { rule = { class = "ROX-Filer" }, properties = { floating = true } }, { rule = { class = "Ark" }, @@ -533,7 +530,8 @@ awful.rules.rules = { { rule = { class = "Pinentry-gtk-2" }, properties = { floating = true } }, { rule = { instance = "firefox-bin" }, - properties = { floating = true } }, + properties = { floating = true }, + callback = awful.titlebar.add }, } -- }}} @@ -542,12 +540,11 @@ awful.rules.rules = { -- -- {{{ Manage signal handler client.add_signal("manage", function (c, startup) - -- Add a titlebar to each new floater - if awful.client.floating.get(c) + -- Add a titlebar to each floater, and + if awful.client.floating.get(c) -- remove those in rule callback or awful.layout.get(c.screen) == awful.layout.suit.floating then - if not c.titlebar and c.class ~= "Xmessage" then - awful.titlebar.add(c, { modkey = modkey }) - end + if c.titlebar then awful.titlebar.remove(c) + else awful.titlebar.add(c, {modkey = modkey}) end end -- Enable sloppy focus @@ -589,8 +586,8 @@ for s = 1, screen.count() do screen[s]:add_signal("arrange", function () for _, c in pairs(clients) do -- Floaters are always on top if awful.client.floating.get(c) or layout == "floating" - then if not c.fullscreen then c.above = true end - else c.above = false end + then if not c.fullscreen then c.above = true end + else c.above = false end end end) end |