import XMonad import XMonad.Actions.CopyWindow import XMonad.Hooks.SetWMName import XMonad.Util.EZConfig import Control.Monad (liftM2) import qualified XMonad.StackSet as W main = xmonad $ def { terminal = "kitty" , borderWidth = 0 , modMask = mod3Mask , startupHook = startup , manageHook = windowManage , workspaces = [ "1:emacs", "2:web", "3", "4", "5", "6", "7", "8", "9" ] } `additionalKeysP` keysP startup = do setWMName "LG3D" spawn "xrandr --auto && xrandr --output DP-1.3 --above DP-2" spawn "xmodmap -e 'add mod3 = Muhenkan'" windowManage = composeAll [ className =? "Emacs" --> doShift "1:emacs" , role =? "browser" --> doShift "2:web" , className =? "viewShiftW3" --> viewShift "3" , className =? "Wire" --> doShift "8" , className =? ".anbox-wrapped" --> doFloat , role =? "gimp- layer-new" --> doFloat , role =? "gimp- color-selector" --> doFloat , role =? "gimp- dock" --> doF W.focusDown , role =? "gimp- toolbox" --> doF W.focusDown , role =? "toolbox_window" --> doF W.focusDown , className =? "Dunst" --> doF W.focusDown <+> doF copyToAll , className =? "Pinentry" --> doFloat <+> doF copyToAll ] where viewShift = doF . liftM2 (.) W.greedyView W.shift role = stringProperty "WM_WINDOW_ROLE" command = stringProperty "WM_COMMAND" notifySend :: Integer -> String -> X () notifySend expireTime shellCommand = spawn $ "DISPLAY=:0 notify-send -t " ++ show expireTime ++ " -h string:bgcolor:#000000 " ++ " \"$(" ++ shellCommand ++ ")\"" -- M - modMask, M1 - Alt, C - Control, S - Shift. Use xev. keysP = [ ("M-l", spawn "xsecurelock") , ("", spawn "escrotum -Cs") , ("", spawn "sudo light -U 3") , ("", spawn "sudo light -A 3") , ("M-S-[", spawn "sudo light -U 3") , ("M-S-]", spawn "sudo light -A 3") , ("M-C-[", spawn "sudo light -S 1") , ("M-C-]", spawn "sudo light -S 100") , ("", spawn "pulsemixer --toggle-mute") , ("", spawn "pulsemixer --change-volume -1") , ("", spawn "pulsemixer --change-volume +1") , ("M-[", spawn "pulsemixer --change-volume -1") , ("M-]", spawn "pulsemixer --change-volume +1") , ("M-\\", spawn "pulsemixer --toggle-mute") , ("M-d", notifySend 3000 "date && TZ='Europe/Paris' date && TZ='Europe/Moscow' date") , ("M-p", spawn "rofi -show run") , ("M-o", spawn "rofi-bluetooth") , ("M-s", spawn "kitty") , ("M-b", notifySend 1000 "acpi -b") ] ++ [ (mask ++ "M-" ++ [key], screenWorkspace scr >>= flip whenJust (windows . action)) | (key, scr) <- zip "wer" [1,0,0] -- was [0..] *** change to match your screen order *** , (action, mask) <- [ (W.view, "") , (W.shift, "S-")] ]