Replace "pmset -g batt" parsing.

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

View File

@ -1144,7 +1144,7 @@ case "$LP_OS" in
_lp_battery()
{
[[ "$LP_ENABLE_BATT" != 1 ]] && return 4
local pmset="$(pmset -g batt | tail -n1)"
local pmset="$(pmset -g batt | sed -n -e '/InternalBattery/p')"
local bat="$(cut -f2 <<<"$pmset")"
bat="${bat%%%*}"
case "$pmset" in