diff options
| author | David Pedersen <Limero@users.noreply.github.com> | 2020-06-28 20:59:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-28 14:59:36 -0400 |
| commit | a0c659d719f11c1606b4e19811a627277524424e (patch) | |
| tree | f9ba7b48c11f00495c2395d8632d689c5636ef64 /.local | |
| parent | 107a99f2743b8412d667c10998677d9ed6ca8fc5 (diff) | |
| download | eibhear-a0c659d719f11c1606b4e19811a627277524424e.tar.gz eibhear-a0c659d719f11c1606b4e19811a627277524424e.tar.zst eibhear-a0c659d719f11c1606b4e19811a627277524424e.zip | |
Prevent error when having no battery (#731)
* Prevent error when having no battery
* Send error to /dev/null instead of separate check
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/statusbar/battery | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index a6fb62d..3536534 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -20,7 +20,7 @@ esac for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. - capacity=$(cat "$battery"/capacity) || break + capacity=$(cat "$battery"/capacity 2>/dev/null) || break 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. |
