Advertisement
mikelieman

mikelieman xmonad.hs

Jul 1st, 2020
3,787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------------------------------------------------------------------
  2. -- | Example.hs
  3. --
  4. -- Example configuration file for xmonad using the latest recommended
  5. -- features (e.g., 'desktopConfig').
  6. module Main (main) where
  7.  
  8. --------------------------------------------------------------------------------
  9. import System.Exit
  10. import XMonad
  11. import XMonad.Config.Desktop
  12. import XMonad.Hooks.DynamicLog
  13. import XMonad.Hooks.EwmhDesktops
  14. import XMonad.Hooks.ManageHelpers
  15.  
  16. import XMonad.Layout.Monitor
  17. import XMonad.Layout.LayoutModifier
  18. import XMonad.Layout.Circle
  19. import XMonad.Layout.Grid
  20. import XMonad.Layout.DecorationMadness
  21.  
  22. --import XMonad.Layout.BinarySpacePartition (emptyBSP)
  23. import XMonad.Layout.NoBorders (noBorders, smartBorders)
  24.  
  25. --import XMonad.Layout.ResizableTile (ResizableTall(..))
  26. --import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
  27. --import XMonad.Prompt
  28. --import XMonad.Prompt.ConfirmPrompt
  29. --import XMonad.Prompt.Shell
  30. import XMonad.Util.EZConfig
  31.  
  32. --------------------------------------------------------------------------------
  33. main = do
  34. --  spawn "xmobar" -- Start a task bar such as xmobar.
  35.  
  36.   -- Start xmonad using the main desktop configuration with a few
  37.   -- simple overrides:
  38.   xmonad  $ ewmh desktopConfig
  39. --  { modMask    = mod4Mask -- Use the "Win" key for the mod key
  40.     { modMask    = mod1Mask -- Use the "Alt" key for the mod key
  41.     , manageHook = myManageHook <+> manageHook desktopConfig
  42.     , layoutHook = smartBorders $ desktopLayoutModifiers $ myLayouts
  43.     , logHook    = dynamicLogString def >>= xmonadPropLog
  44.     , handleEventHook = handleEventHook def <+> fullscreenEventHook
  45.     , terminal   =  "xterm -e tmux"
  46.     , normalBorderColor  = "gray" -- "#dddddd"
  47.     , focusedBorderColor = "rebeccapurple"  -- "#ff0000" don't use hex, not <24 bit safe
  48.     }
  49.  
  50.     `additionalKeys` -- Add some extra key bindings:
  51.     [     ((0, xK_Print), spawn "spectacle")
  52. --      , ("M-S-q",   confirmPrompt myXPConfig "exit" (io exitSuccess))
  53. --      , ("M-p",     shellPrompt myXPConfig)
  54. --      , ("M-<Esc>", sendMessage (Toggle "Full"))
  55.     ]
  56.  
  57. --------------------------------------------------------------------------------
  58. -- | Customize layouts.
  59. --
  60. -- This layout configuration uses two primary layouts, 'ResizableTall'
  61. -- and 'BinarySpacePartition'.  You can also use the 'M-<Esc>' key
  62. -- binding defined above to toggle between the current layout and a
  63. -- full screen layout.
  64. --
  65. -- myLayouts = toggleLayouts (noBorders Full) others
  66. --   where
  67. --     others = ResizableTall 1 (1.5/100) (3/5) [] ||| emptyBSP
  68.  
  69. myLayouts = noBorders tiled ||| noBorders (Mirror tiled) ||| noBorders Full ||| noBorders Circle ||| noBorders Grid
  70.   where
  71.      -- default tiling algorithm partitions the screen into two panes
  72.      tiled   = Tall nmaster delta ratio
  73.      
  74.      -- The default number of windows in the master pane
  75.      nmaster = 1
  76.      
  77.      -- Default proportion of screen occupied by master pane
  78.      ratio   = 1/2
  79.      
  80.      -- Percent of screen to increment by when resizing panes
  81.      delta   = 3/100
  82.      
  83. --------------------------------------------------------------------------------
  84. -- | Customize the way 'XMonad.Prompt' looks and behaves.  It's a
  85. -- great replacement for dzen.
  86. -- myXPConfig = def
  87. --  { position          = Top
  88. --  , alwaysHighlight   = True
  89. --  , promptBorderWidth = 0
  90. --  , font              = "xft:monospace:size=9"
  91. --  }
  92.  
  93. --------------------------------------------------------------------------------
  94. -- | Manipulate windows as they are created.  The list given to
  95. -- @composeOne@ is processed from top to bottom.  The first matching
  96. -- rule wins.
  97. --
  98. -- Use the `xprop' tool to get the info you need for these matches.
  99. -- For className, use the second value that xprop gives you.
  100. myManageHook = composeAll
  101.     [ className =? "Gimp"           --> doFloat
  102.     , (className =? "Firefox" <&&> resource =? "Dialog") --> doFloat
  103.     , className =? "Cairo-dock"     --> doIgnore
  104.     , resource  =? "desktop_window" --> doIgnore
  105.     , resource  =? "kdesktop"       --> doIgnore
  106.     , className =? "Steam"          --> doFloat
  107.     , className =? "steam"          --> doFullFloat -- bigpicture-mode
  108.     , className =? "MPlayer"        --> doFloat
  109.     , (isFullscreen --> doFullFloat)
  110.     ]
  111.  
  112. --myManageHook = composeOne
  113. --  [ className =? "Pidgin" -?> doFloat
  114. --  , className =? "XCalc"  -?> doFloat
  115. --  , className =? "mpv"    -?> doFloat
  116. --  , isDialog              -?> doCenterFloat
  117.  
  118.     -- Move transient windows to their parent:
  119. --  , transience
  120. --  ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement