1
0
localhost/etc/xmonad.hs

79 lines
3.2 KiB
Haskell
Raw Normal View History

2019-07-18 19:51:19 +00:00
import XMonad
import XMonad.Actions.CopyWindow
import XMonad.Hooks.SetWMName
import XMonad.Util.EZConfig
2019-07-24 19:13:54 +00:00
import Control.Monad (liftM2)
2019-07-18 19:51:19 +00:00
import qualified XMonad.StackSet as W
2019-07-23 19:09:24 +00:00
main = xmonad $ def
2019-07-18 19:51:19 +00:00
{ terminal = "kitty"
, borderWidth = 0
2019-09-07 08:24:52 +00:00
, modMask = mod3Mask
2019-07-18 19:51:19 +00:00
, startupHook = startup
, manageHook = windowManage
, workspaces = [ "1:emacs", "2:web", "3", "4", "5", "6", "7", "8", "9" ]
} `additionalKeysP` keysP
startup = do
setWMName "LG3D"
2019-09-07 08:24:52 +00:00
spawn "xmodmap -e 'add mod3 = Muhenkan'"
2019-07-18 19:51:19 +00:00
windowManage = composeAll
[ className =? "Emacs" --> doShift "1:emacs"
, role =? "browser" --> doShift "2:web"
2019-07-24 19:13:54 +00:00
, className =? "viewShiftW3" --> viewShift "3"
, className =? "Wire" --> doShift "8"
2019-10-16 17:21:22 +00:00
, className =? ".anbox-wrapped" --> doFloat
2019-07-18 19:51:19 +00:00
, 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
2019-07-18 19:51:19 +00:00
]
where
2019-07-24 19:13:54 +00:00
viewShift = doF . liftM2 (.) W.greedyView W.shift
2019-07-18 19:51:19 +00:00
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.
2020-01-06 15:29:14 +00:00
keysP = [ ("M-l", spawn "xsecurelock")
2019-07-18 19:51:19 +00:00
, ("<Print>", spawn "escrotum -Cs")
, ("<XF86MonBrightnessDown>", spawn "sudo light -U 3")
, ("<XF86MonBrightnessUp>", 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")
2019-07-18 19:51:19 +00:00
, ("<XF86AudioMute>", spawn "pulsemixer --toggle-mute")
, ("<XF86AudioLowerVolume>", spawn "pulsemixer --change-volume -1")
, ("<XF86AudioRaiseVolume>", spawn "pulsemixer --change-volume +1")
, ("M-[", spawn "pulsemixer --change-volume -1")
, ("M-]", spawn "pulsemixer --change-volume +1")
, ("M-\\", spawn "pulsemixer --toggle-mute")
2021-10-07 13:47:47 +00:00
, ("M-d", notifySend 3000 "date && TZ='Europe/Paris' date && TZ='Europe/Moscow' date")
, ("M-p", spawn "rofi -show run")
, ("M-o", spawn "rofi-bluetooth")
2019-07-18 19:51:19 +00:00
, ("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-")]
]