From 9ddcdea56a49c1933ba7194c0aa87eb3589cf7ff Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 17 Aug 2014 16:16:53 +0100 Subject: XMonad: Reformat and refactor Follow comma-first style. Extract manage hook --- tag-xmonad/xmonad/xmonad.hs | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'tag-xmonad') diff --git a/tag-xmonad/xmonad/xmonad.hs b/tag-xmonad/xmonad/xmonad.hs index 4b67cb48..9e1fa77f 100644 --- a/tag-xmonad/xmonad/xmonad.hs +++ b/tag-xmonad/xmonad/xmonad.hs @@ -4,31 +4,35 @@ import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Layout.NoBorders +import XMonad.Util.EZConfig import XMonad.Util.Run(spawnPipe) import System.IO import Data.List(isPrefixOf) +myManageHook :: ManageHook +myManageHook = composeOne + [ className =? "Firefox" -?> doShift "2" + , className =? "Pidgin" -?> doShift "3" + , className =? "nuvolaplayer" -?> doShift "8" + , className =? "Transmission-gtk" -?> doShift "9" + , isFullscreen -?> doFullFloat + , fmap ("mpv" `isPrefixOf`) title -?> doFullFloat + ] + main :: IO () main = do xmproc <-spawnPipe "/usr/bin/xmobar /home/alan/.xmobarrc" - xmonad $ defaultConfig { - manageHook = composeOne [ - className =? "Firefox" -?> doShift "2", - className =? "Pidgin" -?> doShift "3", - className =? "nuvolaplayer" -?> doShift "8", - className =? "Transmission-gtk" -?> doShift "9", - isFullscreen -?> doFullFloat, - fmap ("mpv" `isPrefixOf`) title -?> doFullFloat - ] <+> manageDocks <+> manageHook defaultConfig, - layoutHook = smartBorders . avoidStruts $ layoutHook defaultConfig, - logHook = dynamicLogWithPP xmobarPP { - ppOutput = hPutStrLn xmproc, - ppTitle = xmobarColor "#859900" "" . shorten 200, - ppCurrent = xmobarColor "#b58900" "". wrap "[" "]", - ppHiddenNoWindows = xmobarColor "#93a1a1" "", - ppUrgent = xmobarColor "#dc322f" "#b58900" - }, - terminal = "urxvt", - modMask = mod4Mask, - handleEventHook = fullscreenEventHook + xmonad $ defaultConfig + { manageHook = myManageHook <+> manageDocks <+> manageHook defaultConfig + , layoutHook = smartBorders . avoidStruts $ layoutHook defaultConfig + , logHook = dynamicLogWithPP xmobarPP + { ppOutput = hPutStrLn xmproc + , ppTitle = xmobarColor "#859900" "" . shorten 200 + , ppCurrent = xmobarColor "#b58900" "". wrap "[" "]" + , ppHiddenNoWindows = xmobarColor "#93a1a1" "" + , ppUrgent = xmobarColor "#dc322f" "#b58900" + } + , terminal = "urxvt" + , modMask = mod4Mask + , handleEventHook = fullscreenEventHook } -- cgit 1.4.1