updated all battery status scripts to use correct method (upower not acpi)

This commit is contained in:
Solomon Laing 2022-06-23 10:19:54 +09:30
parent fa33716fd3
commit 8215ca0023
2 changed files with 7789 additions and 6 deletions

7781
nohup.out Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,13 @@
icon="" icon=""
current=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/%.*//' | sed 's/.*, //') status=$(bash-status-bat)
parts=($status)
current=$(echo "${parts[0]}" | sed 's/\%//')
state=${parts[1]}
status="$current%" status="$current%"
state=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/,.*//' | sed 's/.*: //')
if [[ "$state" == "Discharging" ]]; then if [[ "$state" == "discharging" ]]; then
case $((current/20)) in case $((current/20)) in
1) 1)
icon="" icon=""
@ -26,16 +28,16 @@ if [[ "$state" == "Discharging" ]]; then
esac esac
fi fi
if [[ "$state" == "Not charging" ]]; then if [[ "$state" == "not-charging" ]]; then
icon="" icon=""
fi fi
if [[ "$state" == "Full" ]]; then if [[ "$state" == "fully-charged" ]]; then
icon="" icon=""
status="Full" status="Full"
fi fi
if [[ "$state" == "Charging" ]]; then if [[ "$state" == "charging" ]]; then
icon="" icon=""
fi fi