waybar: add mouse baterry indicator

This commit is contained in:
Leonardo Eugênio 2025-09-01 01:09:19 -03:00
parent 910670ba0b
commit b8cd22e425
7 changed files with 96 additions and 24 deletions

View file

@ -10,29 +10,20 @@ if test -z "$CONTROLLER"; then
fi
CAPACITY=$(cat "$CONTROLLER/capacity")
STATUS=$(cat "$CONTROLLER/status")
echo -n '󰊴'
echo -n '󰊴 '
if test "$CAPACITY" -ge 90; then
echo '󰁹'
elif test "$CAPACITY" -ge 90; then
echo '󰂂'
elif test "$CAPACITY" -ge 80; then
echo '󰂁'
elif test "$CAPACITY" -ge 70; then
echo '󰂀'
elif test "$CAPACITY" -ge 60; then
echo '󰁿'
elif test "$CAPACITY" -ge 50; then
echo '󰁾'
elif test "$CAPACITY" -ge 40; then
echo '󰁽'
elif test "$CAPACITY" -ge 30; then
echo '󰁼'
elif test "$CAPACITY" -ge 20; then
echo '󰁻'
elif test "$CAPACITY" -ge 10; then
echo '󰁺'
if test "$STATUS" = "Charging"; then
echo -n "󰂄"
else
echo '󰂎'
print-battery-icon "$CAPACITY"
fi
# Add terminating newline
echo
# Tooltip
echo -n '󰊴'
print-battery-icon "$CAPACITY"
echo " $CAPACITY%"