battstat.sh (332B)
1 #! /bin/ksh 2 3 while true 4 do 5 PER=$(apm -l) 6 # MIN=$(apm -m) 7 TIME=$(date +"%a %b %e %Y %H:%M %Z") 8 if [ $(apm -a) == 1 ]; then 9 ICON="🔌" 10 else 11 ICON="🔋" 12 fi 13 #echo -n " " $PER "% | Mins left: " $MIN " | " $TIME 14 echo "" # Make a new line so the next command doesn't run on 15 echo -n " "$ICON$PER"% | " $TIME 16 17 sleep 30 18 done