diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-17 19:30:56 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-17 19:30:56 +0100 |
commit | 93b14ece7fbe75c09221621e49e16cc245f5b1de (patch) | |
tree | 8f7d66bf91ae8e5e1785edb4f0062cb6c8733b99 /i3blocks | |
parent | 97c24cfef14427189842464a70166a81659b39bf (diff) | |
download | scripts-93b14ece7fbe75c09221621e49e16cc245f5b1de.tar.gz scripts-93b14ece7fbe75c09221621e49e16cc245f5b1de.zip |
i3battery.sh now reads battery name from env var.
Diffstat (limited to 'i3blocks')
-rwxr-xr-x | i3blocks/i3battery.sh | 5 |
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 |