From 74bb9b8946b778ea93d5885236009baa9ac4fef9 Mon Sep 17 00:00:00 2001 From: sajenim Date: Tue, 25 Apr 2023 08:03:41 +0800 Subject: [PATCH] update xmonad --- config/xmonad/xmonad.hs | 125 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/config/xmonad/xmonad.hs b/config/xmonad/xmonad.hs index d1e8c72..0a65536 100644 --- a/config/xmonad/xmonad.hs +++ b/config/xmonad/xmonad.hs @@ -1,4 +1,127 @@ import XMonad +import System.Exit +-- Actions +import XMonad.Actions.CycleWS +-- Hooks +import XMonad.Hooks.EwmhDesktops +-- Layout +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Spacing +import XMonad.Layout.Renamed +-- Util +import XMonad.Util.EZConfig (additionalKeysP) +-- xmobar dependencies +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import XMonad.Util.Loggers +-- qualified imports +import qualified XMonad.StackSet as W main :: IO () -main = xmonad def +main = xmonad + . ewmhFullscreen + . ewmh + . withEasySB (statusBarProp "candybar" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig + +myConfig = def + { modMask = myModMask + , layoutHook = myLayout + , terminal = myTerminal + , borderWidth = myBorderWidth + , normalBorderColor = myNormalBorderColor + , focusedBorderColor = myFocusedBorderColor + , workspaces = myWorkspaces + } `additionalKeysP` myKeys + +-- | Keybindings +myKeys = + -- launching and killing programs + [ ("M-n" , spawn myTerminal ) -- %! Launch terminal + , ("M-e" , spawn "dmenu_run" ) -- %! Launch dmenu + , ("M-C-w" , kill ) -- %! Close the focused window + -- layouts + , ("M-" , sendMessage NextLayout ) -- %! Rotate through the available layout algorithms + , ("M-f" , sendMessage $ JumpToLayout "Full") -- %! Focus fullscreen layout + -- move focus up or down the window stack + , ("M-" , windows W.focusDown ) -- %! Move focus to the next window + , ("M-" , windows W.focusUp ) -- %! Move focus to the previous window + , ("M-" , windows W.focusMaster ) -- %! Move focus to the master window + -- modifying the window order + , ("M-S-" , windows W.swapDown ) -- %! Swap the focused window with the next window + , ("M-S-" , windows W.swapUp ) -- %! Swap the focused window with the previous window + , ("M-S-" , windows W.swapMaster ) -- %! Swap the focused window with the master window + -- resizing the master/slave ratio + , ("M-" , sendMessage Expand ) -- %! Expand the master area + , ("M-" , sendMessage Shrink ) -- %! Shrink the master area + -- number of windows in the master area + , ("M-S-" , sendMessage (IncMasterN 1) ) -- %! Increase the number of windows in the master area + , ("M-S-", sendMessage (IncMasterN (-1)) ) -- %! Decrease the number of windows in the master area + -- floating layer support + , ("M-t" , withFocused $ windows . W.sink ) -- %! Push window back into tiling + -- workspace navigation + , ("M-" , moveTo Next hiddenWS ) -- %! Move focus to the next hidden workspace + , ("M-" , moveTo Prev hiddenWS ) -- %! Move focus to the previous hidden workspace + -- move window to workspace + , ("M-S-" , shiftTo Next hiddenWS ) -- %! Move focused window to the next hidden workspace + , ("M-S-