mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
commit
b3e999af07
@ -31,12 +31,9 @@ for battery in /sys/class/power_supply/BAT?*; do
|
|||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
capacity="$(cat "$battery/capacity" 2>&1)"
|
capacity="$(cat "$battery/capacity" 2>&1)"
|
||||||
if [ "$status" = "🔋" ]; then
|
test $status = '🔋' && \
|
||||||
# Changes the icon if lower than 50% and discharging
|
test $capacity -le 50 && stat='🪫' && \
|
||||||
[ "$capacity" -le 50 ] && status="🪫"
|
test $capacity -le 25 && warn='❗'
|
||||||
# Will make a warn variable if discharging and very low
|
|
||||||
[ "$capacity" -le 25 ] && warn="❗"
|
|
||||||
fi
|
|
||||||
# Prints the info
|
# Prints the info
|
||||||
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
|
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
|
||||||
done && printf "\\n"
|
done && printf "\\n"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user