summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors
diff options
context:
space:
mode:
authorJuraj Hercek <juhe_haskell@hck.sk>2007-12-23 00:10:39 +0100
committerJuraj Hercek <juhe_haskell@hck.sk>2007-12-23 00:10:39 +0100
commit112d0191be18b474c750664f683e17c9e919d020 (patch)
tree5c32cd279485f17a27aa6b271d5990d549ca8263 /Plugins/Monitors
parentdd497d3e9b20d2ed5c1b88769ca6ebcbf0b184b1 (diff)
downloadxmobar-112d0191be18b474c750664f683e17c9e919d020.tar.gz
xmobar-112d0191be18b474c750664f683e17c9e919d020.tar.bz2
Adjusted thermal monitor.
- Thermal monitor can handle more thermal zones now darcs-hash:20071222231039-f49a6-0a8a2f7d575f7e82adbd9b3ee261d046e616dc07.gz
Diffstat (limited to 'Plugins/Monitors')
-rw-r--r--Plugins/Monitors/Thermal.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Plugins/Monitors/Thermal.hs b/Plugins/Monitors/Thermal.hs
index 2794a60..4814aa5 100644
--- a/Plugins/Monitors/Thermal.hs
+++ b/Plugins/Monitors/Thermal.hs
@@ -24,11 +24,12 @@ thermalConfig = mkMConfig
["temp"] -- available replacements
runThermal :: [String] -> Monitor String
-runThermal _ = do
- let file = "/proc/acpi/thermal_zone/THM/temperature"
+runThermal args = do
+ let zone = head args
+ file = "/proc/acpi/thermal_zone/" ++ zone ++ "/temperature"
exists <- io $ fileExist file
case exists of
- False -> return "Thermal: N/A"
+ False -> return $ "Thermal (" ++ zone ++ "): N/A"
True -> do number <- io $ B.readFile file
>>= return . (read :: String -> Int)
. stringParser (1, 0)