summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/CpuFreq.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-10-27 16:20:25 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-10-27 16:20:25 +0100
commit3d2af8a47332235d6556d2d2a40f7392269cf0b0 (patch)
tree75f75e4dd2bbae0106b77e333213ee6c9b6d4754 /src/Plugins/Monitors/CpuFreq.hs
parent7e89ff8e2007e057a0b00a5a9c1fd953c565db25 (diff)
downloadxmobar-3d2af8a47332235d6556d2d2a40f7392269cf0b0.tar.gz
xmobar-3d2af8a47332235d6556d2d2a40f7392269cf0b0.tar.bz2
New N/A string monitor option (cf. #119)
Diffstat (limited to 'src/Plugins/Monitors/CpuFreq.hs')
-rw-r--r--src/Plugins/Monitors/CpuFreq.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Plugins/Monitors/CpuFreq.hs b/src/Plugins/Monitors/CpuFreq.hs
index 6209ef3..8334d1a 100644
--- a/src/Plugins/Monitors/CpuFreq.hs
+++ b/src/Plugins/Monitors/CpuFreq.hs
@@ -30,10 +30,10 @@ cpuFreqConfig = mkMConfig
-- |
-- Function retrieves monitor string holding the cpu frequency (or frequencies)
runCpuFreq :: [String] -> Monitor String
-runCpuFreq _ =
+runCpuFreq _ = do
let path = ["/sys/devices/system/cpu/cpu", "/cpufreq/scaling_cur_freq"]
divisor = 1e6 :: Double
- failureMessage = "CpuFreq: N/A"
fmt x | x < 1 = (show (round (x * 1000) :: Integer)) ++ "MHz"
| otherwise = (show x) ++ "GHz"
- in checkedDataRetrieval failureMessage path Nothing (/divisor) fmt
+ failureMessage <- getConfigValue naString
+ checkedDataRetrieval failureMessage path Nothing (/divisor) fmt