From ae8a0e12d6c4e99ff56ed96dda180173e0966c0d Mon Sep 17 00:00:00 2001 From: Ada Joule Date: Sat, 3 Feb 2018 14:59:02 +0700 Subject: Honour -d switch in CpuFreq --- src/Plugins/Monitors/CpuFreq.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Plugins/Monitors/CpuFreq.hs b/src/Plugins/Monitors/CpuFreq.hs index 8301547..e6ce07d 100644 --- a/src/Plugins/Monitors/CpuFreq.hs +++ b/src/Plugins/Monitors/CpuFreq.hs @@ -32,10 +32,11 @@ cpuFreqConfig = runCpuFreq :: [String] -> Monitor String runCpuFreq _ = do suffix <- getConfigValue useSuffix + ddigits <- getConfigValue decDigits let path = ["/sys/devices/system/cpu/cpu", "/cpufreq/scaling_cur_freq"] divisor = 1e6 :: Double fmt x | x < 1 = show (round (x * 1000) :: Integer) ++ if suffix then "MHz" else "" - | otherwise = show x ++ if suffix then "GHz" else "" + | otherwise = showDigits ddigits x ++ if suffix then "GHz" else "" failureMessage <- getConfigValue naString checkedDataRetrieval failureMessage [path] Nothing (/divisor) fmt -- cgit v1.2.3