import XMonad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar.PP import XMonad.Util.Run (spawnPipe) import XMonad.Util.EZConfig import XMonad.Util.Loggers import XMonad.Layout.Magnifier import XMonad.Layout.ThreeColumns import XMonad.Actions.CycleWS import XMonad.Hooks.EwmhDesktops import System.Process (readProcess) main :: IO () main = xmonad . ewmhFullscreen . ewmh =<< xmobar myConfig myConfig = def { modMask = mod4Mask -- Rebind Mod to the Super key , terminal = "alacritty" , layoutHook = myLayout -- Use custom layouts , manageHook = myManageHook -- Match on certain windows , workspaces = myWorkspaces , focusedBorderColor = "#8BC34A" -- Salad green } `additionalKeysP` [ ("M-C-s", unGrab *> spawn "scrot -s" ) , ("M-S-Return", spawn "firefox hello") , ("M-S-p", spawn "rofi -show combi -modes combi -combi-modes window,drun,run -show-icons") , ("M-h" , prevWS ) , ("M-l" , nextWS ) , ("M-S-h", sendMessage Shrink ) , ("M-S-l", sendMessage Expand ) ] myManageHook :: ManageHook myManageHook = composeAll [ className =? "Gimp" --> doFloat , isDialog --> doFloat , className =? "Alacritty" --> doShift "term" ] myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol where threeCol = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio tiled = Tall nmaster delta ratio nmaster = 1 -- Default number of windows in the master pane ratio = 1/2 -- Default proportion of screen occupied by master pane delta = 3/100 -- Percent of screen to increment by when resizing panes myWorkspaces = [ "web" , "term" , "dev" , "art" , "img" , "conf" , "chat" ] myXmobarPP :: PP myXmobarPP = def { ppSep = magenta " • " , ppTitleSanitize = xmobarStrip , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 10 , ppHidden = white . wrap " " "" , ppHiddenNoWindows = lowWhite . wrap " " "" , ppUrgent = red . wrap (yellow "!") (yellow "!") , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] , ppExtras = [logTitles formatFocused formatUnfocused] } where formatFocused = wrap (white "[") (white "]") . magenta . ppWindow formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow -- | Windows should have *some* title, which should not not exceed a -- sane length. ppWindow :: String -> String ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 blue, lowWhite, magenta, red, white, yellow :: String -> String magenta = xmobarColor "#ff79c6" "" blue = xmobarColor "#bd93f9" "" white = xmobarColor "#f8f8f2" "" yellow = xmobarColor "#f1fa8c" "" red = xmobarColor "#ff5555" "" lowWhite = xmobarColor "#bbbbbb" ""