mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Send error to /dev/null instead of separate check
This commit is contained in:
parent
25576ab467
commit
0233b85189
@ -20,8 +20,7 @@ esac
|
|||||||
for battery in /sys/class/power_supply/BAT?
|
for battery in /sys/class/power_supply/BAT?
|
||||||
do
|
do
|
||||||
# Get its remaining capacity and charge status.
|
# Get its remaining capacity and charge status.
|
||||||
[ -f "$battery"/capacity ] || break
|
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
|
||||||
capacity=$(cat "$battery"/capacity)
|
|
||||||
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status)
|
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status)
|
||||||
|
|
||||||
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user