Corey Mwamba

status → 10th Dec 2015

Entries for 10th Dec 2015

Small battery-checking script:

#!/bin/bash   
eval $(acpi -b | sed "s/Battery 0: //g" |sed "s/,//g"| awk 'BEGIN {FS=" "};  {print "ch="$1, "percent="$2, "countdown="substr($3,0,5)}')   
case $ch in   
    Discharging)   
    sign="-"   
    ;;   
    Unknown)   
    sign="~"   
    ;;   
    Charging)   
    sign="+"   
esac   
echo $percent $sign$countdown   
exit 0