summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Mem.hs
diff options
context:
space:
mode:
authorAlexander Shabalin <shabalyn.a@gmail.com>2014-09-24 12:31:54 +0400
committerAlexander Shabalin <shabalyn.a@gmail.com>2014-09-24 12:31:54 +0400
commitf8b7b22253d72b7b6ecf83bac87a8cda41040f49 (patch)
tree38705b1e87c9f8e7a74d8f2de502fec2c7de1725 /src/Plugins/Monitors/Mem.hs
parente26731b1fc292a16230f6517aa292dd3973929ae (diff)
downloadxmobar-f8b7b22253d72b7b6ecf83bac87a8cda41040f49.tar.gz
xmobar-f8b7b22253d72b7b6ecf83bac87a8cda41040f49.tar.bz2
Rename dynamic string to icon pattern
Diffstat (limited to 'src/Plugins/Monitors/Mem.hs')
-rw-r--r--src/Plugins/Monitors/Mem.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Plugins/Monitors/Mem.hs b/src/Plugins/Monitors/Mem.hs
index 7524989..b19c5a7 100644
--- a/src/Plugins/Monitors/Mem.hs
+++ b/src/Plugins/Monitors/Mem.hs
@@ -19,22 +19,22 @@ import qualified Data.Map as M
import System.Console.GetOpt
data MemOpts = MemOpts
- { usedDynamicString :: Maybe DynamicString
- , freeDynamicString :: Maybe DynamicString
+ { usedIconPattern :: Maybe IconPattern
+ , freeIconPattern :: Maybe IconPattern
}
defaultOpts :: MemOpts
defaultOpts = MemOpts
- { usedDynamicString = Nothing
- , freeDynamicString = Nothing
+ { usedIconPattern = Nothing
+ , freeIconPattern = Nothing
}
options :: [OptDescr (MemOpts -> MemOpts)]
options =
- [ Option "" ["used-dynamic-string"] (ReqArg (\x o ->
- o { usedDynamicString = Just $ parseDynamicString x }) "") ""
- , Option "" ["free-dynamic-string"] (ReqArg (\x o ->
- o { freeDynamicString = Just $ parseDynamicString x }) "") ""
+ [ Option "" ["used-icon-pattern"] (ReqArg (\x o ->
+ o { usedIconPattern = Just $ parseIconPattern x }) "") ""
+ , Option "" ["free-icon-pattern"] (ReqArg (\x o ->
+ o { freeIconPattern = Just $ parseIconPattern x }) "") ""
]
parseOpts :: [String] -> IO MemOpts
@@ -46,7 +46,7 @@ parseOpts argv =
memConfig :: IO MConfig
memConfig = mkMConfig
"Mem: <usedratio>% (<cache>M)" -- template
- ["usedbar", "usedvbar", "useddstr", "freebar", "freevbar", "freedstr", "usedratio", "freeratio",
+ ["usedbar", "usedvbar", "usedipat", "freebar", "freevbar", "freeipat", "usedratio", "freeratio",
"total", "free", "buffer", "cache", "rest", "used"] -- available replacements
fileMEM :: IO String
@@ -76,14 +76,14 @@ formatMem opts (r:fr:xs) =
rr = 100 * r
ub <- showPercentBar rr r
uvb <- showVerticalBar rr r
- udstr <- showDynamicString (usedDynamicString opts) r
+ uipat <- showIconPattern (usedIconPattern opts) r
fb <- showPercentBar (100 - rr) (1 - r)
fvb <- showVerticalBar (100 - rr) ( 1 - r)
- fdstr <- showDynamicString (freeDynamicString opts) (1 - r)
+ fipat <- showIconPattern (freeIconPattern opts) (1 - r)
rs <- showPercentWithColors r
fs <- showPercentWithColors fr
s <- mapM (showWithColors f) xs
- return (ub:uvb:udstr:fb:fvb:fdstr:rs:fs:s)
+ return (ub:uvb:uipat:fb:fvb:fipat:rs:fs:s)
formatMem _ _ = replicate 10 `fmap` getConfigValue naString
runMem :: [String] -> Monitor String