Transparency bindings and rules

This commit is contained in:
crater2150 2012-03-06 08:47:26 +01:00
parent e53d6c6853
commit 44668f7af9
2 changed files with 22 additions and 4 deletions

View file

@ -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 )
)

View file

@ -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 } },
}