xmonad.hs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 =? "MiniBrowser" -?> doShift "2"
  25. , className =? "ffplay" -?> doShift "3"
  26. , className =? "mpv" -?> doShift "3"
  27. , className =? "Pidgin" -?> doF focusDown
  28. ]
  29. where
  30. role = stringProperty "WM_WINDOW_ROLE"
  31. promptConfig = defaultXPConfig
  32. { font = "xft:monospace-10"
  33. , borderColor = "#1e2320"
  34. , fgColor = "#dddddd"
  35. , bgColor = "#1e2320"
  36. , fgHLight = "#ffffff"
  37. , bgHLight = "#5f5f5f"
  38. , height = 16
  39. , position = Top
  40. }
  41. main = xmonad $ docks $ def
  42. { borderWidth = 0
  43. , focusFollowsMouse = False
  44. , clickJustFocuses = False
  45. , logHook = dynamicLogString xmobarPP
  46. { ppTitle = xmobarColor "green" ""
  47. , ppVisible = wrap "[" "]"
  48. , ppSort = getSortByXineramaPhysicalRule horizontalScreenOrderer
  49. } >>= xmonadPropLog
  50. , modMask = mod4Mask
  51. , manageHook = manageHook def <+> myManageHook
  52. , layoutHook = myLayout
  53. , handleEventHook = handleEventHook def <+> docksEventHook
  54. , terminal = "st"
  55. }
  56. `additionalKeys`
  57. [ ((mod4Mask, xK_b), sendMessage ToggleStruts)
  58. , ((mod4Mask .|. shiftMask, xK_g ), windowPrompt promptConfig { autoComplete = Just 500000 } Goto allWindows)
  59. , ((mod4Mask .|. shiftMask, xK_b ), windowPrompt promptConfig Bring allWindows)
  60. ]