Massive change to the structure of the tree.

This commit is contained in:
Bartek Stalewski 2025-03-10 23:59:38 +01:00
parent 2fc5f7a514
commit c71934ed3b
Signed by: ftpd
SSH key fingerprint: SHA256:vGQiaNJcfUMLt3wF58+Zx15C6SpRDA9spUeggjVY8Yo
137 changed files with 51 additions and 266 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="\uf063" ;;
"Charging") status="\uf062" ;;
"Not charging") status="\uf444"; exit 0 ;;
"Unknown") status="\uf128" ;;
esac
capacity=$(cat "$battery/capacity")
# Will make a warn variable if discharging and low
[ "$capacity" -le 20 ] && printf "<span background='#770000' foreground='#ffffff'>${status} ${capacity}%%</span>" || printf "${status} ${capacity}%%"
done && exit 0