daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 12th, 2018 93 in 23 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   1 import Graphics.X11.ExtraTypes.XF86
  2.   2 import XMonad
  3.   3 import qualified XMonad.StackSet as W
  4.   4 import XMonad.Actions.SpawnOn
  5.   5 import XMonad.Actions.WorkspaceNames
  6.   6 import XMonad.Hooks.DynamicLog
  7.   7 import XMonad.Hooks.ManageDocks
  8.   8 import XMonad.Hooks.ManageHelpers
  9.   9 import XMonad.Layout.LayoutScreens
  10.  10 import XMonad.Layout.TwoPane
  11.  11 import XMonad.Util.Run(spawnPipe)
  12.  12 import XMonad.Util.EZConfig(additionalKeys)
  13.  13 import System.IO
  14.  14
  15.  15
  16.  16
  17.  17
  18.  18 -- Necessary for avoidMaster.
  19.  19 import qualified XMonad.StackSet as W
  20.  20
  21.  21
  22.  22 myWorkspaces = [ "1", "2", "3", "4", "5", "6", "7", "8", "9" ]
  23.  23
  24.  24 -- Prevent new windows from spawning in the master pane. Taken from
  25.  25 --, title   =? "view"             --> doShift "7"
  26.  26 --, title   =? "view"             --> doFloatAt 0 0.0
  27.  27 avoidMaster :: W.StackSet i l a s sd -> W.StackSet i l a s sd
  28.  28 avoidMaster = W.modify' $ \c -> case c of
  29.  29     W.Stack t [] (r:rs) -> W.Stack r [] (t:rs)
  30.  30     otherwise           -> c
  31.  31
  32.  32
  33.  33 main = do
  34.  34     xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/.xmobarrc"
  35.  35     xmonad $ defaultConfig
  36.  36         { manageHook = manageSpawn
  37.  37                         <+> myManageHook
  38.  38                         <+> manageDocks
  39.  39                         <+> manageHook defaultConfig
  40.  40         , layoutHook = avoidStruts  $  layoutHook defaultConfig
  41.  41         , logHook = dynamicLogWithPP xmobarPP
  42.  42                         { ppOutput = hPutStrLn xmproc
  43.  43                         , ppTitle = xmobarColor "green" "" . shorten 50
  44.  44                         }
  45.  45         , borderWidth = 3
  46.  46         , terminal    = "urxvt"
  47.  47         , workspaces  = myWorkspaces
  48.  48         , normalBorderColor = "#cccccc"
  49.  49         , focusedBorderColor = "#4949a7"
  50.  50         , startupHook = startup
  51.  51         } `additionalKeys`
  52.  52         [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
  53.  53         , ((0, xF86XK_AudioLowerVolume  ), spawn "amixer set Master 2-"     )
  54.  54         , ((0, xF86XK_AudioRaiseVolume  ), spawn "amixer set Master 2+"     )
  55.  55         , ((0, xF86XK_AudioMute         ), spawn "amixer set Master toggle" )
  56.  56         , ((0, 0x1008ff81               ), spawn "xscreensaver-command -lock")
  57.  57         ]
  58.  58
  59.  59 myManageHook :: ManageHook
  60.  60
  61.  61 -- just an example of how to lock a window title to a
  62.  62 -- specific desktop
  63.  63 myManageHook = composeAll $
  64.  64     [ appName =? "model"            --> doFloat
  65.  65     , title   =? "Factor"           --> doFloat
  66.  66     ]
  67.  67
  68.  68
  69.  69
  70.  70 startup :: X ()
  71.  71 startup = do
  72.  72     spawn       "compton -c"
  73.  73     spawn       "xmodmap ~/.Xmodmap"
  74.  74     spawnOn "9" "xfce4-mixer"
  75.  75     spawnOn "9" "pavucontrol"
  76.  76     spawnOn "9" "gmpc"
  77.  77     spawnOn "8" "exec chromium-browser"
  78.  78     spawn       "xrdb -load ~/.Xresources"
  79.  79     spawn       "~/bin/wppr.sh /usr/share/xfce4/backdrops"
  80.  80
  81.  81 --{ manageHook = manageDocks <+> myManageHook <+> manageSpawn <+> manageHook defaultConfig
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top