battery (273B)
1 #!/bin/sh 2 3 battery=$(cat /sys/class/power_supply/BAT0/capacity) 4 condition=$(cat /sys/class/power_supply/BAT0/status) 5 6 if [ $condition = "Charging" ]; then 7 echo "🔌$battery" 8 elif [ $condition = "Discharging" ]; then 9 echo "🔋$battery" 10 else 11 echo "🔋Full" 12 fi