status-bar.sh 532 B

123456789101112131415161718
  1. #!/bin/bash
  2. read -r temp < /sys/class/thermal/thermal_zone0/temp
  3. temp=$((temp / 1000))
  4. #headphone=$(amixer get 'Headphone' | grep "Left: Playback" | cut -f 7 -d ' ')
  5. IFS=$',\r'
  6. read -r x y bat_capacity bat_volts bat_amps a b </var/log/reformd
  7. bat_capacity=$(echo $bat_capacity | tr -d Ah)
  8. bat_amps=$(echo "-($bat_amps)" | tr -d A | bc)
  9. bat_percent=$(echo "scale=2;$bat_capacity/10.0*100" | bc)
  10. #bat_hours=$(echo "scale=1;($bat_capacity-1.0)/$bat_amps" | bc)
  11. echo -n "BAT $bat_percent% (${bat_amps}A ${bat_volts}V) $temp°C"