Switch back to macOS.

This commit is contained in:
Bartek Stalewski 2024-06-19 16:19:39 +02:00
parent f8866a9eca
commit e819a06cda
No known key found for this signature in database
137 changed files with 192 additions and 23 deletions

View file

@ -0,0 +1,17 @@
#!/bin/bash
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
# Sets up the status and capacity
case "$(cat "$battery/status")" in
"Full") status="\uf102" ;;
"Discharging") status="\uf078" ;;
"Charging") status="\uf077" ;;
"Not charging") status="\uf444" ;;
"Unknown") status="\uf128" ;;
esac
capacity=$(cat "$battery/capacity")
# Will make a warn variable if discharging and low
[ "$capacity" -le 20 ] && printf "^c#ffffff^^b#770000^${status} ${capacity}%%^d^" || printf "${status} ${capacity}%%"
done && exit 0