updated bat status to use correct method

This commit is contained in:
Solomon Laing 2022-06-21 17:37:22 +09:30
parent e675a92c21
commit 385d742676

View File

@ -1,10 +1,10 @@
#!/bin/bash
current=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/%.*//' | sed 's/.*, //')
state=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/,.*//' | sed 's/.*: //')
current=$(upower -i $(upower -e | grep 'BAT') | grep -E "percentage" | sed 's/.*://' | sed 's/ *//')
state=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | sed 's/.*://' | sed 's/ *//')
if [[ "$state" == "Not charging" ]]; then
state="Full"
if [[ "$state" == "not charging" ]]; then
state="full"
fi
echo "$current% $state"