summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-07-20 13:52:58 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-07-20 13:52:58 +0200
commit99069c2fe2c1af51224ca204c15705d5f7f076fa (patch)
tree8141e7ba56024aa84d75cff65594ea0acca08fab
parent202ff98aac0c1c8029261e69c509f0c1e6390c59 (diff)
downloadxmobar-99069c2fe2c1af51224ca204c15705d5f7f076fa.tar.gz
xmobar-99069c2fe2c1af51224ca204c15705d5f7f076fa.tar.bz2
Honouring -d in CoreTemp
Fixes issue #115
-rw-r--r--news.md14
-rw-r--r--src/Plugins/Monitors/CoreTemp.hs15
2 files changed, 22 insertions, 7 deletions
diff --git a/news.md b/news.md
index a4b0fc3..86e5ab7 100644
--- a/news.md
+++ b/news.md
@@ -6,6 +6,20 @@ _New features_
- New monitor `BatteryN`, a variant of `BatteryP` that lets you
specify the name of the monitor in the template.
+ - Support for configuration file living in XDG_CONFIG_HOME (see
+ [github #99]).
+
+_Bug fixes_
+
+ - Honour the "-d" option in `CoreTemp` ([github #115])
+ - Fix for systems not supporting PCRE regular expressions: we use
+ now BCEs, so regex-compat should be enough everywhere (see
+ [github #117]).
+
+
+[github #99]: https://github.com/jaor/xmobar/issues/115
+[github #115]: https://github.com/jaor/xmobar/issues/115
+[github #117]: https://github.com/jaor/xmobar/issues/117
## Version 0.18 (June 5, 2013)
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'