Add backlight modalbind

This commit is contained in:
crater2150 2020-10-26 15:07:13 +01:00
parent d489ddc9e1
commit 34c291256a
2 changed files with 18 additions and 1 deletions

View file

@ -63,6 +63,22 @@ local messengermap = {
{"w", binder.spawn("wire"), "Wire" }, {"w", binder.spawn("wire"), "Wire" },
} }
local function brightnesskey(key)
return {key, binder.spawn("xbacklight -set " .. key .. "0"), key .. "0%" }
end
local brightnessmap = {
brightnesskey("1"),
brightnesskey("2"),
brightnesskey("3"),
brightnesskey("4"),
brightnesskey("5"),
brightnesskey("6"),
brightnesskey("7"),
brightnesskey("8"),
brightnesskey("9"),
{"0", binder.spawn("xbacklight -set 100"), "100%" },
}
local progmap = { local progmap = {
{"f", binder.spawn("firefox"), "Firefox" }, {"f", binder.spawn("firefox"), "Firefox" },
{"q", binder.spawn("qutebrowser"), "Qutebrowser" }, {"q", binder.spawn("qutebrowser"), "Qutebrowser" },
@ -104,6 +120,7 @@ local myglobalkeys = awful.util.table.join(
--awful.key({ modkey, "Shift" }, "m", mb.grabf(mpdpromts, "MPD - Search for")), --awful.key({ modkey, "Shift" }, "m", mb.grabf(mpdpromts, "MPD - Search for")),
awful.key({ modkey }, "c", mb.grabf{keymap=progmap, name="Commands"}), awful.key({ modkey }, "c", mb.grabf{keymap=progmap, name="Commands"}),
awful.key({ modkey }, "d", mb.grabf{keymap=docmap, name="Documents"}), awful.key({ modkey }, "d", mb.grabf{keymap=docmap, name="Documents"}),
awful.key({ modkey }, "b", mb.grabf{keymap=brightnessmap, name="Brightness"}),
awful.key({ modkey }, "n", function() awful.key({ modkey }, "n", function()
if naughty.is_suspended() then if naughty.is_suspended() then
naughty.resume() naughty.resume()

View file

@ -140,7 +140,7 @@ awful.key({ modkey, "Shift" }, "l", screen_move_client_wrapdir("right")),
awful.key({ modkey, "Control" }, "o", function (c) c.ontop = not c.ontop end), awful.key({ modkey, "Control" }, "o", function (c) c.ontop = not c.ontop end),
awful.key({ modkey, "Shift" }, "a", function (c) c.sticky = not c.sticky end), awful.key({ modkey, "Shift" }, "a", function (c) c.sticky = not c.sticky end),
awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
awful.key({ modkey, }, "b", function (c) c.border_width = c.border_width > 0 and 0 or beautiful.border_width end), --awful.key({ modkey, }, "b", function (c) c.border_width = c.border_width > 0 and 0 or beautiful.border_width end),
awful.key({ modkey, }, "Up", function(c) client_opacity_set(c, 1, 1, 0.1) 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({ modkey, }, "Down", function(c) client_opacity_set(c, 1, 0, -0.1) end),
awful.key({ }, "XF86Calculater", awful.client.movetoscreen ), awful.key({ }, "XF86Calculater", awful.client.movetoscreen ),