diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-11-23 14:03:53 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-11-23 14:03:53 +0100 |
commit | 43cc28333261be2eafc44c6fc984ad46299bad4b (patch) | |
tree | 74367b80d319666bd45e5a0a5ba01eeb3247179e /bindings.lua | |
parent | 3e06b7abcfe76196ea19631634fa71172415d13a (diff) |
bindings: add binding for lid close/open
Diffstat (limited to 'bindings.lua')
-rw-r--r-- | bindings.lua | 11 |
1 files changed, 11 insertions, 0 deletions
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), |