summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/MultiCpu.hs
diff options
context:
space:
mode:
authorslotThe <soliditsallgood@tuta.io>2020-01-04 21:20:56 +0100
committerjao <jao@gnu.org>2020-01-04 21:21:40 +0000
commit940be3bb32ed1f11c46ede98d51516998b17e128 (patch)
tree6d0c942c10efc64514dd419f746f631aec19c935 /src/Xmobar/Plugins/Monitors/MultiCpu.hs
parent2ec513d2e193998958ad5bf4a5f7280f595792e9 (diff)
downloadxmobar-940be3bb32ed1f11c46ede98d51516998b17e128.tar.gz
xmobar-940be3bb32ed1f11c46ede98d51516998b17e128.tar.bz2
Replace parseOpts with a generic function
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/MultiCpu.hs')
-rw-r--r--src/Xmobar/Plugins/Monitors/MultiCpu.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Xmobar/Plugins/Monitors/MultiCpu.hs b/src/Xmobar/Plugins/Monitors/MultiCpu.hs
index 5e5c273..936bb2e 100644
--- a/src/Xmobar/Plugins/Monitors/MultiCpu.hs
+++ b/src/Xmobar/Plugins/Monitors/MultiCpu.hs
@@ -47,12 +47,6 @@ options =
, Option "" ["contiguous-icons"] (NoArg (\o -> o {contiguous = True})) ""
]
-parseOpts :: [String] -> IO MultiCpuOpts
-parseOpts argv =
- case getOpt Permute options argv of
- (o, _, []) -> return $ foldr id defaultOpts o
- (_, _, errs) -> ioError . userError $ concat errs
-
variables :: [String]
variables = ["bar", "vbar","ipat","total","user","nice","system","idle"]
vNum :: Int
@@ -122,7 +116,7 @@ formatAutoCpus opts xs =
runMultiCpu :: CpuDataRef -> [String] -> Monitor String
runMultiCpu cref argv =
do c <- io $ parseCpuData cref
- opts <- io $ parseOpts argv
+ opts <- io $ parseOptsWith options defaultOpts argv
l <- formatMultiCpus opts c
a <- formatAutoCpus opts l
parseTemplate $ a ++ l