logo

dotfiles

My dotfiles, one branch per machine, rebased on base git clone https://hacktivis.me/git/dotfiles.git

xmonad.hs (2039B)


  1. import XMonad
  2. import XMonad.Hooks.DynamicLog
  3. import XMonad.Hooks.ManageDocks
  4. import XMonad.Hooks.ManageHelpers -- transience
  5. import XMonad.Actions.PhysicalScreens -- horizontalScreenOrderer
  6. import XMonad.Util.WorkspaceCompare -- getSortByXineramaPhysicalRule
  7. import XMonad.Util.EZConfig -- additionalKeys
  8. import XMonad.Prompt
  9. import XMonad.Prompt.Window -- windowPrompt
  10. import XMonad.StackSet (focusDown)
  11. import XMonad.Layout.Grid
  12. myLayout = avoidStruts (Full ||| tiled ||| Mirror tiled ||| Grid )
  13. where
  14. tiled = Tall nmaster delta ratio
  15. nmaster = 1
  16. ratio = 1/2
  17. delta = 3/100
  18. myManageHook = composeOne
  19. [ transience
  20. , role =? "browser" -?> doShift "2"
  21. , isDialog -?> doFloat
  22. , className =? "st-256color" -?> doShift "1"
  23. , className =? "Navigator" -?> doShift "2"
  24. , className =? "ffplay" -?> doShift "3"
  25. , className =? "mpv" -?> doShift "3"
  26. , className =? "Pidgin" -?> doF focusDown
  27. ]
  28. where
  29. role = stringProperty "WM_WINDOW_ROLE"
  30. promptConfig = defaultXPConfig
  31. { font = "xft:monospace-10"
  32. , borderColor = "#1e2320"
  33. , fgColor = "#dddddd"
  34. , bgColor = "#1e2320"
  35. , fgHLight = "#ffffff"
  36. , bgHLight = "#5f5f5f"
  37. , height = 16
  38. , position = Top
  39. }
  40. main = xmonad $ docks $ def
  41. { borderWidth = 0
  42. , focusFollowsMouse = False
  43. , clickJustFocuses = False
  44. , logHook = dynamicLogString xmobarPP
  45. { ppTitle = xmobarColor "green" ""
  46. , ppVisible = wrap "[" "]"
  47. , ppSort = getSortByXineramaPhysicalRule horizontalScreenOrderer
  48. } >>= xmonadPropLog
  49. , modMask = mod4Mask
  50. , manageHook = manageHook def <+> myManageHook
  51. , layoutHook = myLayout
  52. , handleEventHook = handleEventHook def <+> docksEventHook
  53. , terminal = "st"
  54. }
  55. `additionalKeys`
  56. [ ((mod4Mask, xK_b), sendMessage ToggleStruts)
  57. , ((mod4Mask .|. shiftMask, xK_g ), windowPrompt promptConfig { autoComplete = Just 500000 } Goto allWindows)
  58. , ((mod4Mask .|. shiftMask, xK_b ), windowPrompt promptConfig Bring allWindows)
  59. ]