From 8d39e40bcf6da354c2e5ff2f1b4b8981c5fcf7f5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 26 May 2023 13:09:02 +0200 Subject: ... --- accounts/gkleen@sif/xmonad/xmonad.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'accounts/gkleen@sif/xmonad') diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs index d6e32aab..906cc663 100644 --- a/accounts/gkleen@sif/xmonad/xmonad.hs +++ b/accounts/gkleen@sif/xmonad/xmonad.hs @@ -896,7 +896,7 @@ myKeys' conf host = Map.fromList $ safeSpawn "loginctl" ["lock-session", sessId] ) , ((modm .|. shiftMask, xK_s ), safeSpawn "systemctl" ["suspend"]) - , ((modm .|. shiftMask, xK_h ), safeSpawn "systemctl" ["poweroff"]) + , ((modm .|. shiftMask, xK_h ), inputPromptWithCompl xPConfigMonospace "systemctl" powerActCompl ?+ powerAct) , ((modm, xK_v ), windows copyToAll) -- @@ Make focused window always visible , ((modm .|. shiftMask, xK_v ), killAllOtherCopies) -- @@ Toggle window state back , ((modm .|. shiftMask, xK_g ), windowPrompt xPConfig Goto wsWindows) @@ -925,3 +925,8 @@ myKeys' conf host = Map.fromList $ modm = XMonad.modMask conf brCycle = [0, 1 % 100, 1 % 10, 1 % 4, 1 % 2, 3 % 4, 1] + + powerActWords = ["poweroff", "reboot", "hibernate", "suspend"] + powerActCompl = mkComplFunFromList' xPConfigMonospace powerActWords + powerAct act | act `elem` powerActWords = safeSpawn "systemctl" $ pure act + | otherwise = return () -- cgit v1.2.3