aLostEngineer

Xmonad.hs

May 4th, 2016
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import XMonad
  2. import XMonad.Config.Desktop
  3. import XMonad.Hooks.DynamicLog
  4. import XMonad.Hooks.ManageDocks
  5. import XMonad.Hooks.ManageHelpers
  6. import XMonad.Hooks.EwmhDesktops
  7. import XMonad.Util.Run(spawnPipe)
  8. import XMonad.Util.EZConfig(additionalKeys)
  9. import XMonad.Actions.WorkspaceNames
  10. import XMonad.Prompt
  11. import XMonad.Layout.NoBorders
  12. import System.IO
  13. import System.Process
  14. import System.Exit
  15.  
  16. import System.Posix.Env (getEnv)
  17. import Data.Maybe (maybe)
  18.  
  19. -- Single-line Prefs
  20.  
  21. myModMask = mod4Mask
  22. myTerminal = "terminator"
  23.  
  24.  
  25. -- Manage Hook Stuff
  26.  
  27. windowRole = stringProperty "WM_WINDOW_ROLE"
  28. windowName = stringProperty "WM_NAME"
  29.  
  30. myWindowRules = composeAll
  31.     [ className     =? "Qasmizer"               --> doFloat
  32.     , className     =? "MiniMetro.x86_64"       --> doFloat
  33.     , windowName    =? "MiniMetro"              --> doFloat
  34.     , (( className  =? "Chromium" ) <&&> ( windowRole =? "pop-up" <||> isInProperty "_NET_WM_STATE" "_NET_WM_STATE_ABOVE" ) )   --> doFloat
  35.     , ( className   =? "Vlc" <&&> isFullscreen ) --> doFullFloat
  36.     ]
  37.  
  38. main = do
  39.     xmproc1 <- spawnPipe "/usr/bin/xmobar /home/cwbell/.xmonad/xmobar.hs"
  40.     xmonad $ ewmh defaultConfig
  41.         { modMask = myModMask
  42.         , handleEventHook = handleEventHook defaultConfig <+> fullscreenEventHook
  43.         , manageHook = myWindowRules <+> manageDocks <+> manageHook defaultConfig
  44.         , terminal = myTerminal
  45.         , layoutHook = avoidStruts $ smartBorders $ layoutHook defaultConfig
  46.         , startupHook = startupHook defaultConfig
  47.         , logHook = ( dynamicLogWithPP =<< workspaceNamesPP xmobarPP
  48.                     { ppOutput = hPutStrLn xmproc1
  49.                     , ppTitle = xmobarColor "green" "" . shorten 50
  50.                     }
  51.                 )
  52.         } `additionalKeys`
  53.         [ (( mod4Mask               .|. controlMask , xK_l      ), spawn "xscreensaver-command -lock")
  54.         , ((                            controlMask , xK_Print  ), spawn "sleep 0.2; scrot -s")
  55.         , (( 0                                      , xK_Print  ), spawn "scrot -e 'mv $f ~/screenshots/'")
  56.         , (( mod4Mask .|. shiftMask                 , xK_r      ), renameWorkspace defaultXPConfig)
  57.         , (( mod4Mask               .|. controlMask , xK_Delete ), io (exitWith ExitSuccess) )
  58.         , (( mod4Mask .|. shiftMask                 , xK_q      ), return() )
  59.         , (( mod4Mask                               , xK_b      ), spawn "chromium --force-device-scale-factor=1" )
  60.         , (( mod4Mask                               , xK_f      ), spawn "xfe")
  61.         ]
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×