diff --git a/bindings.lua b/bindings.lua index 76adeab..b677136 100644 --- a/bindings.lua +++ b/bindings.lua @@ -133,6 +133,19 @@ globalkeys = awful.util.table.join( --}}} ) +function client_opacity_set(c, default, max, step) + if c.opacity < 0 or c.opacity > 1 then + c.opacity = default + end + + if c.opacity * step < (max-step) * step then + c.opacity = c.opacity + step + else + c.opacity = max + end +end + + clientkeys = awful.util.table.join( awful.key({ modkey, "Shift" }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), @@ -143,7 +156,8 @@ clientkeys = awful.util.table.join( awful.key({ modkey, }, "a", function (c) c.sticky = not c.sticky end), awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end), - + awful.key({ modkey, }, "Up", function(c) client_opacity_set(c, 1, 1, 0.1) end), + awful.key({ modkey, }, "Down", function(c) client_opacity_set(c, 1, 0, -0.1) end), awful.key({ }, "XF86Calculater", awful.client.movetoscreen ) ) diff --git a/rules.lua b/rules.lua index c5b4827..222710f 100644 --- a/rules.lua +++ b/rules.lua @@ -27,7 +27,7 @@ awful.rules.rules = { properties = { tag = tags[rule_screen][2], floating = false, minimized = false } }, { rule = { class = "Pidgin" }, - properties = { tag = tags[rule_screen][3]} }, + properties = { tag = tags[rule_screen][3], opacity = 0.9 } }, { rule = { role = "buddy_list" }, properties = { master = true } }, { rule = { role = "conversation" }, @@ -50,8 +50,6 @@ awful.rules.rules = { properties = { tag = tags[rule_screen][6] } }, { rule = { class = "Deluge" }, properties = { tag = tags[rule_screen][7] } }, - { rule = { class = "Xhtop" }, - properties = { tag = tags[rule_screen][22] } }, { rule = { class = "Cellwriter" }, properties = { tag = tags[rule_screen][1], ontop = true, @@ -60,4 +58,10 @@ awful.rules.rules = { sticky = true, fullscreen = true } }, + { rule = { class = "Xhtop" }, + properties = { tag = tags[rule_screen][22] } }, + { rule = { class = "URxvt" }, + properties = { opacity = 0.9 } }, + { rule = { instance = "URxvt" }, + properties = { opacity = 0.9 } }, }