From 93b14ece7fbe75c09221621e49e16cc245f5b1de Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Tue, 17 Dec 2019 19:30:56 +0100 Subject: i3battery.sh now reads battery name from env var. --- i3blocks/i3battery.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'i3blocks') 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 -- cgit v1.2.1