summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2021-06-16 20:05:29 +0400
committerAndrew <saintruler@gmail.com>2021-06-16 20:05:29 +0400
commit331b5145d70da7d0e748330f5ae6b6e7af3e9866 (patch)
treebefe7581515ef20585e2ad5aa153cbb42cd4c7c6 /.local
parent03c38c671eb6e8960fde871f12f69aeea5079978 (diff)
Fixed dwm-battery script when there is no battery in computer
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/dwmbar/dwm-battery2
1 files changed, 2 insertions, 0 deletions
diff --git a/.local/bin/dwmbar/dwm-battery b/.local/bin/dwmbar/dwm-battery
index c2e66a3..11ad5c3 100755
--- a/.local/bin/dwmbar/dwm-battery
+++ b/.local/bin/dwmbar/dwm-battery
@@ -1,4 +1,6 @@
#!/bin/sh
+
+[ -z "$(ls /sys/class/power_supply/)" ] && echo "none" && exit 0
for battery in /sys/class/power_supply/BAT?
do
capacity=$(cat "$battery"/capacity) || break