summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors
diff options
context:
space:
mode:
authorFelix Springer <felixspringer149@gmail.com>2019-07-14 23:55:51 +0200
committerFelix Springer <felixspringer149@gmail.com>2019-07-14 23:55:51 +0200
commit21c4c0f640c14c386d486ca9863011ef0101c367 (patch)
treeb5aee30e24d735b636d3a9376d17ce0e46c06710 /src/Xmobar/Plugins/Monitors
parent093dcb3d47f00e9865cf9dfdb33a2508bec56128 (diff)
downloadxmobar-21c4c0f640c14c386d486ca9863011ef0101c367.tar.gz
xmobar-21c4c0f640c14c386d486ca9863011ef0101c367.tar.bz2
allow seperate icon-patterns in MultiCoreTelp
Diffstat (limited to 'src/Xmobar/Plugins/Monitors')
-rw-r--r--src/Xmobar/Plugins/Monitors/MultiCoreTemp.hs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Xmobar/Plugins/Monitors/MultiCoreTemp.hs b/src/Xmobar/Plugins/Monitors/MultiCoreTemp.hs
index b0325dc..90fd6d0 100644
--- a/src/Xmobar/Plugins/Monitors/MultiCoreTemp.hs
+++ b/src/Xmobar/Plugins/Monitors/MultiCoreTemp.hs
@@ -22,23 +22,30 @@ import System.Directory ( doesDirectoryExist
)
-- | Declare Options.
-data CTOpts = CTOpts { loadIconPattern :: Maybe IconPattern
+data CTOpts = CTOpts { maxIconPattern :: Maybe IconPattern
+ , avgIconPattern :: Maybe IconPattern
, mintemp :: Float
, maxtemp :: Float
}
-- | Set default Options.
defaultOpts :: CTOpts
-defaultOpts = CTOpts { loadIconPattern = Nothing
+defaultOpts = CTOpts { maxIconPattern = Nothing
+ , avgIconPattern = Nothing
, mintemp = 0
, maxtemp = 100
}
-- | Apply configured Options.
options :: [OptDescr (CTOpts -> CTOpts)]
-options = [ Option [] ["load-icon-pattern"]
+options = [ Option [] ["max-icon-pattern"]
(ReqArg
- (\ arg opts -> opts { loadIconPattern = Just $ parseIconPattern arg })
+ (\ arg opts -> opts { maxIconPattern = Just $ parseIconPattern arg })
+ "")
+ ""
+ , Option [] ["avg-icon-pattern"]
+ (ReqArg
+ (\ arg opts -> opts { avgIconPattern = Just $ parseIconPattern arg })
"")
""
, Option [] ["mintemp"]
@@ -132,13 +139,13 @@ formatCT opts cTs = do let CTOpts { mintemp = minT
mp <- showWithColors' (show (round (100*maxCTPc) :: Int)) maxCT
mb <- showPercentBar maxCT maxCTPc
mv <- showVerticalBar maxCT maxCTPc
- mi <- showIconPattern (loadIconPattern opts) maxCTPc
+ mi <- showIconPattern (maxIconPattern opts) maxCTPc
a <- showTempWithColors avgCT
ap <- showWithColors' (show (round (100*avgCTPc) :: Int)) avgCT
ab <- showPercentBar avgCT avgCTPc
av <- showVerticalBar avgCT avgCTPc
- ai <- showIconPattern (loadIconPattern opts) avgCTPc
+ ai <- showIconPattern (avgIconPattern opts) avgCTPc
let ms = [ m , mp , mb , mv , mi ]
as = [ a , ap , ab , av , ai ]