Skip to content

Instantly share code, notes, and snippets.

@crater2150
Created March 14, 2012 12:26
Show Gist options
  • Save crater2150/2036143 to your computer and use it in GitHub Desktop.
Save crater2150/2036143 to your computer and use it in GitHub Desktop.
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(
-- insert other clientkeys here ...
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.rules.rules = {
-- ...
{ rule = { class = "Pidgin" },
properties = { tag = tags[rule_screen][3], opacity = 0.9 } },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment