xmonad_configuration/xmonad.hs

66 lines
2.0 KiB
Haskell
Raw Normal View History

2025-09-05 22:26:47 +02:00
--
import XMonad
import XMonad.Config.Desktop
import XMonad.Util.Run (safeSpawn)
import qualified Data.Map as M
import qualified XMonad.StackSet as W
import System.Exit
import System.Environment (getEnvironment)
import XMonad.Util.EZConfig
myWorkspaces = ["1","2","3","4","5","6","7","8"]
mateConfig = desktopConfig
{ terminal = "mate-terminal"
, keys = mateKeys <+> keys desktopConfig
}
mateKeys (XConfig {modMask = modm}) = M.fromList $
[ ((modm, xK_p), mateRun)
, ((modm .|. shiftMask, xK_q), spawn "mate-session-save --kill") ]
mateRun :: X ()
mateRun = withDisplay $ \dpy -> do
rw <- asks theRoot
mate_panel <- getAtom "_MATE_PANEL_ACTION"
panel_run <- getAtom "_MATE_PANEL_ACTION_RUN_DIALOG"
io $ allocaXEvent $ \e -> do
setEventType e clientMessage
setClientMessageEvent e rw mate_panel 32 panel_run 0
sendEvent dpy rw False structureNotifyMask e
sync dpy False
main = do
xmonad $ mateConfig
{ modMask = mod4Mask
, borderWidth = 2
, workspaces = myWorkspaces
, focusedBorderColor = "#FF0000"
} `additionalKeysP` myKeys
2025-09-05 22:33:02 +02:00
myKeys = [ -- APP BINDING
(("M4-f"), spawn "brave-bin")
,(("M4-s"), spawn "spotify")
2025-09-05 22:26:47 +02:00
,(("M4-<Return>"), spawn "mate-terminal")
,(("M4-p"), spawn "dmenu_run")
2025-09-05 22:33:02 +02:00
-- KILL APP
2025-09-05 22:26:47 +02:00
,(("M4-z"), kill)
2025-09-05 22:33:02 +02:00
-- BINDING XMONAD RELOAD
,(("M4-S-q"), io exitSuccess)
,(("M4-q"), spawn "xmonad --recompile; xmonad --restart")
-- BINDING FOR MOVE WORKSPACE
2025-09-05 22:26:47 +02:00
,(("M4-<F1>"), windows $ W.greedyView "1")
,(("M4-<F2>"), windows $ W.greedyView "2")
,(("M4-<F3>"), windows $ W.greedyView "3")
,(("M4-<F4>"), windows $ W.greedyView "4")
,(("M4-<F5>"), windows $ W.greedyView "5")
,(("M4-<F6>"), windows $ W.greedyView "6")
,(("M4-<F7>"), windows $ W.greedyView "7")
,(("M4-<F8>"), windows $ W.greedyView "8")
]