gdritter repos dotfiles / 56ca02b
Add copy/paste functionality Getty Ritter 3 years ago
1 changed file(s) with 12 addition(s) and 0 deletion(s). Collapse all Expand all
1111 import qualified System.Exit as Sys
1212 import qualified System.IO as Sys
1313 import qualified System.Process as Sys
14 import qualified Graphics.X11.ExtraTypes.XF86 as X11
1415
1516 import XMonad ((|||), (<+>))
1617 import qualified XMonad as XM
1920 import qualified XMonad.Hooks.SetWMName as XM
2021 import qualified XMonad.Layout.NoBorders as XM
2122 import qualified XMonad.Layout.Tabbed as Tab
23 import qualified XMonad.Util.Paste as Paste
2224 import qualified XMonad.Util.Run as Run
2325
2426 -- | A 'ColorScheme' represents a handful of salient colors used in
4951 , ((mdMask, XM.xK_u), XM.spawn "amixer -q sset Master 3%+")
5052 , ((mdMask, XM.xK_d), XM.spawn "amixer -q sset Master 3%-")
5153 , ((mdMask, XM.xK_m), XM.spawn "amixer -q sset Master 0%")
54 , ((mdMask, XM.xK_c), xCopy)
55 , ((mdMask, XM.xK_v), Paste.pasteSelection)
5256 , ((mdMask, 0x1008ff13), XM.spawn "amixer -q set Master 3%+")
5357 , ((mdMask, 0x1008ff12), XM.spawn "amixer set Master toggle")
5458 , ((mdMask, 0x1008ff11), XM.spawn "amixer -q set Master 3%-")
5761 , ((mdMask, 0x1008ff16), XM.spawn "mpc prev")
5862 , ((mdMask, 0x1008ff17), XM.spawn "mpc next")
5963 ]
64
65 xCopy :: XM.X ()
66 xCopy = XM.withFocused $ \w -> do
67 winName <- XM.runQuery XM.className w
68 if winName == "Alacritty"
69 then (Paste.sendKey XM.noModMask X11.xF86XK_Copy)
70 else (Paste.sendKey XM.controlMask XM.xK_c)
71
6072
6173 recompile :: IO ()
6274 recompile = do