updated all battery status scripts to use correct method (upower not acpi)
This commit is contained in:
parent
fa33716fd3
commit
8215ca0023
@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user