Handle more battery states
This commit is contained in:
parent
3ef4cf45a8
commit
3a5621ec82
1 changed files with 15 additions and 6 deletions
|
|
@ -20,12 +20,21 @@ fi
|
||||||
|
|
||||||
battery=$(cat /sys/class/power_supply/BAT0/capacity)
|
battery=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||||
battery_state=$(cat /sys/class/power_supply/BAT0/status)
|
battery_state=$(cat /sys/class/power_supply/BAT0/status)
|
||||||
battery_symbol="❔"
|
case "${battery_state}" in
|
||||||
if [ "${battery_state}" = "Charging" ]; then
|
"Charging"|"Full"|"Not charging")
|
||||||
battery_symbol="🗲"
|
battery_symbol="🔌"
|
||||||
elif [ "${battery_state}" = "Discharging" ]; then
|
;;
|
||||||
battery_symbol="🔋"
|
"Discharging")
|
||||||
fi
|
if [ "${battery}" -lt 20 ]; then
|
||||||
|
battery_symbol="🪫"
|
||||||
|
else
|
||||||
|
battery_symbol="🔋"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
battery_symbol="❔"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
weather=$(cat /tmp/weather-report.txt)
|
weather=$(cat /tmp/weather-report.txt)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue