diff options
Diffstat (limited to '')
-rw-r--r-- | src/XMonad/Custom/Log.hs | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/src/XMonad/Custom/Log.hs b/src/XMonad/Custom/Log.hs index 49b7334..1bf05f1 100644 --- a/src/XMonad/Custom/Log.hs +++ b/src/XMonad/Custom/Log.hs @@ -1,5 +1,21 @@ +----------------------------------------------------------------------------- +-- | +-- Module : XMonad.Custom.Log +-- Copyright : (c) azahi 2018 +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : azahi <azahi@teknik.io> +-- Stability : unstable +-- Portability : unportable +-- +-- Provides configuration for logging to be used +-- with various status display applications +-- +----------------------------------------------------------------------------- + module XMonad.Custom.Log - ( logHook' ) where + ( logHook' + ) where import System.IO import XMonad @@ -13,7 +29,7 @@ import XMonad.Util.SpawnNamedPipe import XMonad.Util.WorkspaceCompare xmobarFont :: Int -> String -> String -xmobarFont fn = wrap (concat ["<fn=", show fn, ">"]) "</fn>" +xmobarFont f = wrap (concat ["<fn=", show f, ">"]) "</fn>" topBarPP :: PP topBarPP = def @@ -27,9 +43,9 @@ topBarPP = def , ppTitle = xmobarColor white1 "" . shorten 50 , ppTitleSanitize = xmobarStrip , ppLayout = xmobarColor white1 "" . \x -> case x of -- TODO Generalize string conversion - "Spacing 12 Tabbed Hidden BSP" -> "Omni.Gaps" - "Tabbed Hidden BSP" -> "Omni" - _ -> "Misc" + "Spacing 12 Tabbed Hidden BSP" -> "Omni.Gaps" + "Tabbed Hidden BSP" -> "Omni" + _ -> "Misc" , ppOrder = id , ppSort = (namedScratchpadFilterOutWorkspace .) <$> getSortByIndex , ppExtras = [] @@ -53,9 +69,9 @@ logHook' :: X () logHook' = do currentWorkspaceOnTop ewmhDesktopsLogHook - b1 <- getNamedPipe "xmobarTop" - b2 <- getNamedPipe "xmobarBot" - c <- wsContainingCopies + t <- getNamedPipe "xmobarTop" + b <- getNamedPipe "xmobarBot" + c <- wsContainingCopies let copiesCurrent ws | ws `elem` c = xmobarColor yellow2 "" . xmobarFont 2 . wrap "*" "=" $ ws | otherwise = xmobarColor white2 "" . xmobarFont 2 . wrap "=" "=" $ ws let copiesHidden ws | ws `elem` c = xmobarColor yellow1 "" . wrap "*" "-" $ ws @@ -66,8 +82,8 @@ logHook' = do { ppCurrent = copiesCurrent , ppHidden = copiesHidden , ppUrgent = copiesUrgent - , ppOutput = safePrintToPipe b1 + , ppOutput = safePrintToPipe t } dynamicLogWithPP $ botBarPP - { ppOutput = safePrintToPipe b2 + { ppOutput = safePrintToPipe b } |