diff options
author | Dhananjay Balan <mail@dbalan.in> | 2020-01-08 19:44:49 +0530 |
---|---|---|
committer | Dhananjay Balan <mail@dbalan.in> | 2020-01-08 19:44:49 +0530 |
commit | 8d8da3e74cf482712f98eee321d30f5bc0f141c1 (patch) | |
tree | 8937146fa928a127ec75e36ba2e3657b515f9c95 /src/Xmobar/Plugins/Monitors | |
parent | 1f7e24bbcf3724f5433f019af4e5255f54805072 (diff) | |
download | xmobar-8d8da3e74cf482712f98eee321d30f5bc0f141c1.tar.gz xmobar-8d8da3e74cf482712f98eee321d30f5bc0f141c1.tar.bz2 |
FreeBSD battery: Condition to notify if battery is full.
Diffstat (limited to 'src/Xmobar/Plugins/Monitors')
-rw-r--r-- | src/Xmobar/Plugins/Monitors/Batt.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Batt.hs b/src/Xmobar/Plugins/Monitors/Batt.hs index 0181f83..4ea7591 100644 --- a/src/Xmobar/Plugins/Monitors/Batt.hs +++ b/src/Xmobar/Plugins/Monitors/Batt.hs @@ -175,11 +175,12 @@ readBatteriesFbsd opts = do tm <- sysctlReadInt "hw.acpi.battery.time" st <- sysctlReadInt "hw.acpi.battery.state" acline <- sysctlReadInt "hw.acpi.acline" - let sts = battStatusFbsd $ fromIntegral st - p = fromIntegral lf / 100 + let p = fromIntegral lf / 100 w = fromIntegral rt t = fromIntegral tm * 60 ac = acline == 1 + -- battery full when rate is 0 and on ac. + sts = if (w == 0 && ac) then Full else (battStatusFbsd $ fromIntegral st) unless ac (maybeAlert opts p) return (Result p w t sts) |