Respect the _lp_battery API.

This commit is contained in:
Anthony Gelibert 2014-01-20 20:54:22 +01:00 committed by Olivier Mengué
parent 10121e3d13
commit 3f1df58ae5

View File

@ -1102,7 +1102,7 @@ case "$LP_OS" in
Linux) Linux)
_lp_battery() _lp_battery()
{ {
[[ "$LP_ENABLE_BATT" != 1 ]] && return [[ "$LP_ENABLE_BATT" != 1 ]] && return 4
local acpi local acpi
acpi="$(acpi --battery 2>/dev/null)" acpi="$(acpi --battery 2>/dev/null)"
# Extract the battery load value in percent # Extract the battery load value in percent
@ -1143,7 +1143,7 @@ case "$LP_OS" in
Darwin) Darwin)
_lp_battery() _lp_battery()
{ {
[[ "$LP_ENABLE_BATT" != 1 ]] && return [[ "$LP_ENABLE_BATT" != 1 ]] && return 4
local pmset="$(pmset -g batt | tail -n1)" local pmset="$(pmset -g batt | tail -n1)"
local bat="$(cut -f2 <<<"$pmset")" local bat="$(cut -f2 <<<"$pmset")"
bat="${bat%%%*}" bat="${bat%%%*}"