aboutsummaryrefslogtreecommitdiff
path: root/i3blocks
diff options
context:
space:
mode:
Diffstat (limited to 'i3blocks')
-rwxr-xr-xi3blocks/i3battery.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh
index 51dfa37..1be8142 100755
--- a/i3blocks/i3battery.sh
+++ b/i3blocks/i3battery.sh
@@ -11,8 +11,9 @@ case $BLOCK_BUTTON in
- Text color reflects charge left" ;;
esac
-status=$(cat /sys/class/power_supply/"$1"/status)
-capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit 0
+battery="$CONFIG_BATTERY"
+status=$(cat /sys/class/power_supply/"$battery"/status)
+capacity=$(cat /sys/class/power_supply/"$battery"/capacity) || exit 0
[ -f "/bin/acpi" ] && remaining="$(acpi | cut -d' ' -f5 | cut -d':' -f-2)" || remaining="missing acpi"
if [ "$capacity" -ge 80 ]; then