diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-12-08 01:38:14 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-12-08 01:38:14 +0100 |
commit | a615474dc2daa250602262d59bd3daa7d603cc12 (patch) | |
tree | 5815a4b4fba629cfea760afdafd20601ce01b341 /Plugins/Monitors/Common.hs | |
parent | 180fab582197384f7018543c106e1b641a0700e0 (diff) | |
download | xmobar-a615474dc2daa250602262d59bd3daa7d603cc12.tar.gz xmobar-a615474dc2daa250602262d59bd3daa7d603cc12.tar.bz2 |
Default to False for the -P option and leave the % to the templates
Diffstat (limited to 'Plugins/Monitors/Common.hs')
-rw-r--r-- | Plugins/Monitors/Common.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 637dbd9..9f1db3c 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -130,7 +130,7 @@ mkMConfig tmpl exprts = bb <- newIORef ":" bf <- newIORef "#" bw <- newIORef 10 - up <- newIORef True + up <- newIORef False return $ MC nc l lc h hc t e p mn mx pc pr bb bf bw up data Opts = HighColor String @@ -184,7 +184,7 @@ doConfigOptions [] = io $ return () doConfigOptions (o:oo) = do let next = doConfigOptions oo nz s = let x = read s in max 0 x - bool s = s == "True" + bool = (`elem` ["True", "true", "Yes", "yes", "On", "on"]) case o of High h -> setConfigValue (read h) high >> next Low l -> setConfigValue (read l) low >> next @@ -198,13 +198,14 @@ doConfigOptions (o:oo) = Width w -> setConfigValue (nz w) minWidth >> setConfigValue (nz w) maxWidth >> next PadChars pc -> setConfigValue pc padChars >> next - PadAlign pa -> setConfigValue (isPrefixOf "r" pa) padRight >> next + PadAlign a -> setConfigValue ("r" `isPrefixOf` a) padRight >> next BarBack bb -> setConfigValue bb barBack >> next BarFore bf -> setConfigValue bf barFore >> next BarWidth bw -> setConfigValue (nz bw) barWidth >> next UsePercent up -> setConfigValue (bool up) usePercent >> next -runM :: [String] -> IO MConfig -> ([String] -> Monitor String) -> Int -> (String -> IO ()) -> IO () +runM :: [String] -> IO MConfig -> ([String] -> Monitor String) -> Int + -> (String -> IO ()) -> IO () runM args conf action r cb = go where go = do c <- conf |