diff options
author | Alexander Shabalin <shabalyn.a@gmail.com> | 2014-09-24 12:31:54 +0400 |
---|---|---|
committer | Alexander Shabalin <shabalyn.a@gmail.com> | 2014-09-24 12:31:54 +0400 |
commit | f8b7b22253d72b7b6ecf83bac87a8cda41040f49 (patch) | |
tree | 38705b1e87c9f8e7a74d8f2de502fec2c7de1725 /src/Plugins/Monitors/MultiCpu.hs | |
parent | e26731b1fc292a16230f6517aa292dd3973929ae (diff) | |
download | xmobar-f8b7b22253d72b7b6ecf83bac87a8cda41040f49.tar.gz xmobar-f8b7b22253d72b7b6ecf83bac87a8cda41040f49.tar.bz2 |
Rename dynamic string to icon pattern
Diffstat (limited to 'src/Plugins/Monitors/MultiCpu.hs')
-rw-r--r-- | src/Plugins/Monitors/MultiCpu.hs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Plugins/Monitors/MultiCpu.hs b/src/Plugins/Monitors/MultiCpu.hs index 9f8c191..eab21da 100644 --- a/src/Plugins/Monitors/MultiCpu.hs +++ b/src/Plugins/Monitors/MultiCpu.hs @@ -22,22 +22,22 @@ import Data.IORef (IORef, newIORef, readIORef, writeIORef) import System.Console.GetOpt data MultiCpuOpts = MultiCpuOpts - { loadDynamicStrings :: [DynamicString] - , loadDynamicString :: Maybe DynamicString + { loadIconPatterns :: [IconPattern] + , loadIconPattern :: Maybe IconPattern } defaultOpts :: MultiCpuOpts defaultOpts = MultiCpuOpts - { loadDynamicStrings = [] - , loadDynamicString = Nothing + { loadIconPatterns = [] + , loadIconPattern = Nothing } options :: [OptDescr (MultiCpuOpts -> MultiCpuOpts)] options = - [ Option "" ["load-dynamic-string"] (ReqArg (\x o -> - o { loadDynamicString = Just $ parseDynamicString x }) "") "" - , Option "" ["load-dynamic-strings"] (ReqArg (\x o -> - o { loadDynamicStrings = parseDynamicString x : loadDynamicStrings o }) "") "" + [ Option "" ["load-icon-pattern"] (ReqArg (\x o -> + o { loadIconPattern = Just $ parseIconPattern x }) "") "" + , Option "" ["load-icon-patterns"] (ReqArg (\x o -> + o { loadIconPatterns = parseIconPattern x : loadIconPatterns o }) "") "" ] parseOpts :: [String] -> IO MultiCpuOpts @@ -47,7 +47,7 @@ parseOpts argv = (_, _, errs) -> ioError . userError $ concat errs variables :: [String] -variables = ["bar", "vbar","dstr","total","user","nice","system","idle"] +variables = ["bar", "vbar","ipat","total","user","nice","system","idle"] vNum :: Int vNum = length variables @@ -91,12 +91,12 @@ formatCpu opts i xs | otherwise = let t = sum $ take 3 xs in do b <- showPercentBar (100 * t) t h <- showVerticalBar (100 * t) t - d <- showDynamicString tryString t + d <- showIconPattern tryString t ps <- showPercentsWithColors (t:xs) return (b:h:d:ps) where tryString - | i == 0 = loadDynamicString opts - | i <= length (loadDynamicStrings opts) = Just $ (loadDynamicStrings opts) !! (i - 1) + | i == 0 = loadIconPattern opts + | i <= length (loadIconPatterns opts) = Just $ (loadIconPatterns opts) !! (i - 1) | otherwise = Nothing splitEvery :: (Eq a) => Int -> [a] -> [[a]] |