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=""
|
||||
|
||||
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%"
|
||||
state=$(acpi --battery | grep -e 'Battery 0' | sed -e 's/,.*//' | sed 's/.*: //')
|
||||
|
||||
if [[ "$state" == "Discharging" ]]; then
|
||||
if [[ "$state" == "discharging" ]]; then
|
||||
case $((current/20)) in
|
||||
1)
|
||||
icon=""
|
||||
@ -26,16 +28,16 @@ if [[ "$state" == "Discharging" ]]; then
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ "$state" == "Not charging" ]]; then
|
||||
if [[ "$state" == "not-charging" ]]; then
|
||||
icon=""
|
||||
fi
|
||||
|
||||
if [[ "$state" == "Full" ]]; then
|
||||
if [[ "$state" == "fully-charged" ]]; then
|
||||
icon=""
|
||||
status="Full"
|
||||
fi
|
||||
|
||||
if [[ "$state" == "Charging" ]]; then
|
||||
if [[ "$state" == "charging" ]]; then
|
||||
icon=""
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user