diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-01-04 21:49:08 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2011-01-04 21:49:08 +0100 |
commit | 4578f0f05de2ad73dffc15b998420b0351693b2b (patch) | |
tree | 411d3b5692db2735e4e4145d74521a3f5f361044 | |
parent | 63d1501764968f3af864f7d16eb89301f9ee8875 (diff) | |
download | xmobar-4578f0f05de2ad73dffc15b998420b0351693b2b.tar.gz xmobar-4578f0f05de2ad73dffc15b998420b0351693b2b.tar.bz2 |
Linting
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | src/Plugins/Monitors/Batt.hs | 24 |
2 files changed, 14 insertions, 13 deletions
@@ -435,7 +435,8 @@ Monitors have default aliases. - `-m`: color to display power lower than the `-H` threshold - `-h`: color to display power highter than the `-H` threshold - `-p`: color to display positive power (battery charging) - - `-f`: file `/sys/class/power_supply` with AC info (default: AC/online) + - `-f`: file in `/sys/class/power_supply` with AC info (default: + "AC/online") - Variables that can be used with the `-t`/`--template` argument: `left`, `leftbar`, `timeleft`, `watts`, `acstatus` - Default template: `Batt: <watts>, <left>% / <timeleft>` diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs index 102f635..e42049f 100644 --- a/src/Plugins/Monitors/Batt.hs +++ b/src/Plugins/Monitors/Batt.hs @@ -76,10 +76,10 @@ battConfig = mkMConfig ["leftbar", "left", "acstatus", "timeleft", "watts"] -- replacements data Files = Files - { f_full :: String - , f_now :: String - , f_voltage :: String - , f_current :: String + { fFull :: String + , fNow :: String + , fVoltage :: String + , fCurrent :: String } | NoFiles data Battery = Battery @@ -98,10 +98,10 @@ batteryFiles bat = (_, True) -> files "/energy" _ -> NoFiles where prefix = base ++ "/" ++ bat - files ch = Files { f_full = prefix ++ ch ++ "_full" - , f_now = prefix ++ ch ++ "_now" - , f_current = prefix ++ "/current_now" - , f_voltage = prefix ++ "/voltage_now" } + files ch = Files { fFull = prefix ++ ch ++ "_full" + , fNow = prefix ++ ch ++ "_now" + , fCurrent = prefix ++ "/current_now" + , fVoltage = prefix ++ "/voltage_now" } haveAc :: FilePath -> IO Bool haveAc f = do @@ -114,10 +114,10 @@ haveAc f = do readBattery :: Files -> IO Battery readBattery NoFiles = return $ Battery 0 0 0 0 readBattery files = - do a <- grab $ f_full files -- microwatthours - b <- grab $ f_now files - c <- grab $ f_voltage files -- microvolts - d <- grab $ f_current files -- microwatts (huh!) + do a <- grab $ fFull files -- microwatthours + b <- grab $ fNow files + c <- grab $ fVoltage files -- microvolts + d <- grab $ fCurrent files -- microwatts (huh!) return $ Battery (3600 * a / 1000000) -- wattseconds (3600 * b / 1000000) -- wattseconds (c / 1000000) -- volts |