summaryrefslogtreecommitdiffhomepage
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
parentfbb987b3c24b296697d7495048bcd272a63b6533 (diff)
downloadxmobar-1ef771a0610ebd9d081bb83b8834077ca752d25a.tar.gz
xmobar-1ef771a0610ebd9d081bb83b8834077ca752d25a.tar.bz2
Improvements for K10Temp's docs
-rw-r--r--doc/plugins.org11
-rw-r--r--src/Xmobar/Plugins/Monitors/K10Temp.hs8
2 files changed, 14 insertions, 5 deletions
diff --git a/doc/plugins.org b/doc/plugins.org
index 907d59f..cb2df22 100644
--- a/doc/plugins.org
+++ b/doc/plugins.org
@@ -462,7 +462,8 @@ something like:
- Aliases to =k10temp=
- - Slot: The PCI slot address of the k10temp device
+ - Slot: The PCI slot address of the k10temp device as a string. You
+ can find it as a subdirectory in =/sys/bus/pci/drivers/k10temp/=.
- Args: default monitor arguments
@@ -484,9 +485,11 @@ something like:
- Example:
#+begin_src haskell
- Run CoreTemp ["-t", "Temp: <Tdie>C|<Tccd1>C",
- "-L", "40", "-H", "60",
- "-l", "lightblue", "-n", "gray90", "-h", "red"] 50
+ Run K10Temp "0000:00:18.3"
+ ["-t", "Temp: <Tdie>C|<Tccd1>C",
+ "-L", "40", "-H", "60",
+ "-l", "lightblue", "-n", "gray90", "-h", "red"]
+ 50
#+end_src
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'