mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Use the new 🪫 emoji in sb-battery
When the battery goes below 50%, the icon now changes to this one
This commit is contained in:
parent
82b70e3a8e
commit
3b71a182d2
@ -9,6 +9,7 @@ case $BLOCK_BUTTON in
|
||||
♻: stagnant charge
|
||||
🔌: charging
|
||||
⚡: charged
|
||||
🪫: less than 50% remaining
|
||||
❗: battery very low!
|
||||
- Scroll to change adjust xbacklight." ;;
|
||||
4) xbacklight -inc 10 ;;
|
||||
@ -30,8 +31,12 @@ for battery in /sys/class/power_supply/BAT?*; do
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
capacity="$(cat "$battery/capacity" 2>&1)"
|
||||
# Will make a warn variable if discharging and low
|
||||
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
||||
if [ "$status" = "🔋" ]; then
|
||||
# Changes the icon if lower than 50% and discharging
|
||||
[ "$capacity" -le 50 ] && status="🪫"
|
||||
# Will make a warn variable if discharging and very low
|
||||
[ "$capacity" -le 25 ] && warn="❗"
|
||||
fi
|
||||
# Prints the info
|
||||
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
|
||||
done && printf "\\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user