From 34c291256a25e74791b7720984d4374e8162dc20 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Mon, 26 Oct 2020 15:07:13 +0100 Subject: [PATCH] Add backlight modalbind --- mybindings.lua | 17 +++++++++++++++++ separable/binder.lua | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mybindings.lua b/mybindings.lua index 46110ee..ea959d7 100644 --- a/mybindings.lua +++ b/mybindings.lua @@ -63,6 +63,22 @@ local messengermap = { {"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 = { {"f", binder.spawn("firefox"), "Firefox" }, {"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 }, "c", mb.grabf{keymap=progmap, name="Commands"}), 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() if naughty.is_suspended() then naughty.resume() diff --git a/separable/binder.lua b/separable/binder.lua index 4518540..94a5ee9 100644 --- a/separable/binder.lua +++ b/separable/binder.lua @@ -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, "Shift" }, "a", function (c) c.sticky = not c.sticky 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, }, "Down", function(c) client_opacity_set(c, 1, 0, -0.1) end), awful.key({ }, "XF86Calculater", awful.client.movetoscreen ),