summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Plugins/Monitors/CoreTemp.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Plugins/Monitors/CoreTemp.hs b/src/Plugins/Monitors/CoreTemp.hs
index 2880751..c6f98da 100644
--- a/src/Plugins/Monitors/CoreTemp.hs
+++ b/src/Plugins/Monitors/CoreTemp.hs
@@ -34,10 +34,11 @@ coreTempConfig = mkMConfig
-- Function retrieves monitor string holding the core temperature
-- (or temperatures)
runCoreTemp :: [String] -> Monitor String
-runCoreTemp _ = let path = ["/sys/bus/platform/devices/coretemp.",
- "/temp",
- "_input"]
- lbl = Just ("_label", read . (dropWhile (not . isDigit)))
- divisor = 1e3 :: Double
- failureMessage = "CoreTemp: N/A"
- in checkedDataRetrieval failureMessage path lbl (/divisor) show
+runCoreTemp _ = do
+ dn <- getConfigValue decDigits
+ let path = ["/sys/bus/platform/devices/coretemp.", "/temp", "_input"]
+ lbl = Just ("_label", read . (dropWhile (not . isDigit)))
+ divisor = 1e3 :: Double
+ failureMessage = "CoreTemp: N/A"
+ show' = showDigits (max 0 dn)
+ checkedDataRetrieval failureMessage path lbl (/divisor) show'