summaryrefslogtreecommitdiff
path: root/rc.lua
diff options
context:
space:
mode:
authorNicolas Schodet2011-11-26 19:13:39 +0100
committerNicolas Schodet2011-11-26 19:13:39 +0100
commit52b83e58f2e910b2abe675e49bab80148702828b (patch)
tree4aa30ae80bb116e67ae90c5f23c5ac71e08ce5b6 /rc.lua
parentc19bc31c600bdefb75156d1adbfd462dc9eaf842 (diff)
automatically struts Gimp
Diffstat (limited to 'rc.lua')
-rw-r--r--rc.lua26
1 files changed, 24 insertions, 2 deletions
diff --git a/rc.lua b/rc.lua
index b1898b3..7a99b4a 100644
--- a/rc.lua
+++ b/rc.lua
@@ -296,6 +296,22 @@ root.keys(globalkeys)
-- }}}
-- {{{ Rules
+
+function struts(c, side)
+ local workarea = screen[c.screen].workarea
+ local width = c:geometry().width
+ local xoffset
+ if side == "left" then
+ c:struts({ left = width })
+ xoffset = 0
+ else
+ c:struts({ right = width })
+ xoffset = workarea.width - width
+ end
+ c:geometry({ x = workarea.x + xoffset, y = workarea.y, width = width,
+ height = workarea.height })
+end
+
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
@@ -306,8 +322,14 @@ awful.rules.rules = {
buttons = clientbuttons } },
{ rule = { class = "MPlayer" },
properties = { floating = true } },
- { rule = { class = "gimp" },
- properties = { floating = true } },
+ { rule = { class = "Gimp" },
+ properties = { tag = tags[1][3] } },
+ { rule = { class = "Gimp", role = "gimp-toolbox" },
+ properties = { floating = true },
+ callback = function (c) struts (c, "left") end },
+ { rule = { class = "Gimp", role = "gimp-dock" },
+ properties = { floating = true },
+ callback = function (c) struts (c, "right") end },
{ rule = { class = "Iceweasel" },
properties = { tag = tags[1][2] } },
{ rule = { class = "Display" },