Fix : no power_supply support message

Close #1
This commit is contained in:
Yann 'Ze' Richard 2012-07-09 13:28:29 +02:00
parent 7c096e567f
commit c1b7e33a64

View File

@ -160,7 +160,11 @@ git_branch_color()
battery()
{
command -v acpi >/dev/null 2>&1 || { echo -n ""; return; }
bat=`acpi --battery | sed "s/^Battery .*, \([0-9]*\)%.*$/\1/"`
bat=`acpi --battery 2>/dev/null | sed "s/^Battery .*, \([0-9]*\)%.*$/\1/"`
if [ "${bat}x" == "x" ] ; then
echo -n ""
return
fi
if [ ${bat} -lt 90 ] ; then
echo -n " ${bat}%"
else