summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-11-21 22:09:46 +0000
committerjao <jao@gnu.org>2021-11-21 22:09:46 +0000
commit1ef771a0610ebd9d081bb83b8834077ca752d25a (patch)
treef28c9b8683a048bd00e3786eb8fada4b9cb5c97e /src/Xmobar/Plugins/Monitors
parentfbb987b3c24b296697d7495048bcd272a63b6533 (diff)
downloadxmobar-1ef771a0610ebd9d081bb83b8834077ca752d25a.tar.gz
xmobar-1ef771a0610ebd9d081bb83b8834077ca752d25a.tar.bz2
Improvements for K10Temp's docs
Diffstat (limited to 'src/Xmobar/Plugins/Monitors')
-rw-r--r--src/Xmobar/Plugins/Monitors/K10Temp.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Xmobar/Plugins/Monitors/K10Temp.hs b/src/Xmobar/Plugins/Monitors/K10Temp.hs
index e76d01a..30b3d90 100644
--- a/src/Xmobar/Plugins/Monitors/K10Temp.hs
+++ b/src/Xmobar/Plugins/Monitors/K10Temp.hs
@@ -28,6 +28,12 @@ k10TempConfig = mkMConfig
] -- available replacements
-- |
+-- Base directory for k10temp system bus
+--
+k10Dir :: String
+k10Dir = "/sys/bus/pci/drivers/k10temp/"
+
+-- |
-- Function retrieves monitor string holding the temperature
-- (or temperatures)
runK10Temp :: [String] -> Monitor String
@@ -35,7 +41,7 @@ runK10Temp args = do
dn <- getConfigValue decDigits
failureMessage <- getConfigValue naString
let slot = head args
- path = ["/sys/bus/pci/drivers/k10temp/" ++ slot ++ "/hwmon/hwmon", "/temp", "_input"]
+ path = [k10Dir ++ slot ++ "/hwmon/hwmon", "/temp", "_input"]
divisor = 1e3 :: Double
show' = showDigits (max 0 dn)
checkedDataRetrieval failureMessage [path] Nothing (/divisor) show'