feat: sbar auto choose battery

This commit is contained in:
AngeD 2023-03-25 08:51:50 +01:00
parent b4ebf3e70e
commit 4fc13d3504
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@ -17,8 +17,9 @@ update_memory() {
} }
update_bat() { update_bat() {
bat="$(grep -q Charging /sys/class/power_supply/BAT0/status && printf '' || printf '')" local dir="$(echo /sys/class/power_supply/BAT* | sort -n | tail -n1)"
bat="$bat $(cat /sys/class/power_supply/BAT0/capacity)%" bat="$(grep -q Charging "$dir/status" && printf '' || printf '')"
bat="$bat $(cat "$dir/capacity")%"
} }
update_vol() { update_vol() {