From a61b046200302171a41fa03a1f21911c7e6e7f60 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 15 Mar 2020 15:28:48 -0400 Subject: [PATCH] ENH reformat xmobar --- bin/xmobar.hs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/bin/xmobar.hs b/bin/xmobar.hs index 2284e8a..f5b9ac8 100644 --- a/bin/xmobar.hs +++ b/bin/xmobar.hs @@ -1,5 +1,7 @@ import Xmobar.Screensaver +import Data.List + import Xmobar import XMonad (getXMonadDir) @@ -22,17 +24,21 @@ sep :: String sep = wrapColor fgColor1 " : " myTemplate :: String -myTemplate = concat - [ "%UnsafeStdinReader%" - , " }{ " - , "%screensaver%" - , sep, "%wlp0s20f3wi%" - , sep, "%alsa:default:Master%" - , sep, "%battery%" - , sep, "%bright%" - , sep, "%locks%" - , sep, "%date% " - ] +myTemplate = formatTemplate left right + where + formatTemplate l r = intercalate sep l + ++ " }{ " + ++ intercalate sep r + ++ " " + left = [ "%UnsafeStdinReader%" ] + right = [ "%wlp0s20f3wi%" + , "%alsa:default:Master%" + , "%battery%" + , "%bright%" + , "%screensaver%" + , "%locks%" + , "%date%" + ] config :: String -> Config config confDir = defaultConfig { @@ -107,7 +113,7 @@ config confDir = defaultConfig { , Run $ Date "%Y-%m-%d %H:%M" "date" 10 - , Run $ Screensaver ("\xf108", fgColor0, fgColor1) 10 + , Run $ Screensaver ("\xf254", fgColor0, fgColor1) 10 , Run UnsafeStdinReader ]