From 43cc28333261be2eafc44c6fc984ad46299bad4b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 23 Nov 2020 14:03:53 +0100 Subject: bindings: add binding for lid close/open --- bindings.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bindings.lua b/bindings.lua index 878e58c..559b5d3 100644 --- a/bindings.lua +++ b/bindings.lua @@ -14,6 +14,17 @@ function M.create(workspace) awful.key({ modkey }, "Pause", function () awful.spawn("xscreensaver-command -lock") end), awful.key({ modkey }, "XF86ScreenSaver", function () awful.spawn("xscreensaver-command -lock") end), + -- something of a hack: diziet is configured to send F13/XF86Tools on lid close + -- this should trigger a screen lock if HDMI cable is not connected + awful.key({ }, "XF86Tools", + function () + awful.spawn.with_shell("cat /sys/class/drm/card0/*HDMI*/status|grep -q '^connected' || xscreensaver-command -suspend") + end), + awful.key({ }, "XF86Launch5", + function () + awful.spawn.with_shell("xscreensaver-command -deactivate") + end), + -- program launching awful.key({ modkey, }, "t", function () utils.spawn_current(commondefs.terminal) end), awful.key({ modkey, }, "v", function () utils.spawn_current(commondefs.terminal .. " -e alsamixer") end), -- cgit v1.2.3