Skip to content

Instantly share code, notes, and snippets.

@bitc
Created May 20, 2021 05:58
Show Gist options
  • Save bitc/9a9634ff483ebb6ed460db7649a79a1f to your computer and use it in GitHub Desktop.
Save bitc/9a9634ff483ebb6ed460db7649a79a1f to your computer and use it in GitHub Desktop.
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import qualified XMonad.StackSet as W
main = do
spawn "xsetroot -solid grey12"
spawn "xsetroot -cursor_name left_ptr"
xmproc <- spawnPipe "xmobar"
xmonad $ ewmh defaultConfig
{ manageHook = manageDocks <+> myManageHook
, layoutHook = avoidStruts $ layoutHook defaultConfig
, handleEventHook = handleEventHook defaultConfig <+> docksEventHook
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "#ff8800" "" . shorten 160
, ppHiddenNoWindows = xmobarColor "#333" ""
}
, modMask = myModMask -- Rebind Mod to the Windows key
, terminal = "xterm"
, normalBorderColor = "#444444"
, focusedBorderColor = "#ff8800"
, borderWidth = 2
, workspaces = myWorkspaces
, startupHook = setWMName "LG3D"
} `additionalKeys` (myKeys)
myModMask = mod4Mask
myExtraWorkspaces = [(xK_0, "0"),(xK_minus, "-"),(xK_equal, "=")]
myWorkspaces = ["1","2","3","4","5","6","7","8","9", "0","-","="]
myKeys =
[ -- ... some more keys ...
] ++ [
((myModMask, key), (windows $ W.greedyView ws))
| (key,ws) <- myExtraWorkspaces
] ++ [
((myModMask .|. shiftMask, key), (windows $ W.shift ws))
| (key,ws) <- myExtraWorkspaces
]
myManageHook = composeAll . concat $
[ [ title =? i --> (doF W.focusDown <+> doFloat) | i <- myClassFloats ]
, [ title =? "xfce4-notifyd" --> doIgnore ]
]
where
myClassFloats = ["termview"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment