diff options
-rw-r--r-- | src/Plugins/Monitors/CoreTemp.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Plugins/Monitors/CoreTemp.hs b/src/Plugins/Monitors/CoreTemp.hs index f7b5c95..2880751 100644 --- a/src/Plugins/Monitors/CoreTemp.hs +++ b/src/Plugins/Monitors/CoreTemp.hs @@ -17,6 +17,9 @@ module Plugins.Monitors.CoreTemp where import Plugins.Monitors.Common import Plugins.Monitors.CoreCommon + +import Data.Char (isDigit) + -- | -- Core temperature default configuration. Default template contains only one -- core temperature, user should specify custom template in order to get more @@ -31,9 +34,10 @@ coreTempConfig = mkMConfig -- Function retrieves monitor string holding the core temperature -- (or temperatures) runCoreTemp :: [String] -> Monitor String -runCoreTemp _ = let path = ["/sys/bus/platform/devices/coretemp.", "/temp", "_input"] - lbl = Just ("_label", read . drop 5) +runCoreTemp _ = let path = ["/sys/bus/platform/devices/coretemp.", + "/temp", + "_input"] + lbl = Just ("_label", read . (dropWhile (not . isDigit))) divisor = 1e3 :: Double failureMessage = "CoreTemp: N/A" in checkedDataRetrieval failureMessage path lbl (/divisor) show - |