From 79aeaede420f97bb15e7792043a93528a2209ba2 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Fri, 8 Apr 2022 13:58:15 +0300 Subject: [PATCH] feat(prog/xmonad): add hotkey to lock screen --- nix/home.nix | 2 +- programs/xmonad/xmonad.hs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nix/home.nix b/nix/home.nix index 2ecf3af..105c71f 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -93,7 +93,7 @@ in services.screen-locker = { enable = true; - lockCmd = "/usr/bin/i3lock -c 000000"; + lockCmd = "/usr/bin/i3lock -e -c 000000"; inactiveInterval = 5; }; diff --git a/programs/xmonad/xmonad.hs b/programs/xmonad/xmonad.hs index 368974b..8d8388a 100644 --- a/programs/xmonad/xmonad.hs +++ b/programs/xmonad/xmonad.hs @@ -127,6 +127,8 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ -- Quit xmonad , ((mod4Mask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) + -- Lock screen + , ((mod4Mask , xK_l ), spawn "i3lock -e -c 000000") -- Restart xmonad , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") @@ -318,9 +320,10 @@ help = unlines ["The default modifier key is 'alt'. Default keybindings:", "mod-comma (mod-,) Increment the number of windows in the master area", "mod-period (mod-.) Deincrement the number of windows in the master area", "", - "-- quit, or restart", - "mod-Shift-q Quit xmonad", - "mod-q Restart xmonad", + "-- System ", + "mod4-l Lock screen", + "mod4-Shift-q Quit xmonad", + "mod-q Restart xmonad", "", "-- Workspaces & screens", "mod-[1..9] Switch to workSpace N",