From e6811f16345abdeb2e97bb19f5e43eb06ace2369 Mon Sep 17 00:00:00 2001 From: azahi Date: Fri, 29 Jun 2018 10:58:41 +0300 Subject: Bump to 0.2.0.1 Minor code tweaks Add header messages Change indentation Move per-module GHC_OPTIONS to their respective module --- src/XMonad/Custom/Log.hs | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'src/XMonad/Custom/Log.hs') 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 +-- 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 [""]) "" +xmobarFont f = wrap (concat [""]) "" 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 } -- cgit 1.4.1