43 lines
556 B
Bash
Executable File
43 lines
556 B
Bash
Executable File
#!/bin/bash
|
|
|
|
icon=""
|
|
|
|
current=$(acpi --battery | sed -e 's/%.*//' | sed 's/.*, //')
|
|
status="$current%"
|
|
state=$(acpi --battery | sed -e 's/,.*//' | sed 's/.*: //')
|
|
|
|
if [[ "$state" == "Discharging" ]]; then
|
|
case $((current/20)) in
|
|
1)
|
|
icon=""
|
|
;;
|
|
2)
|
|
icon=""
|
|
;;
|
|
3)
|
|
icon=""
|
|
;;
|
|
4)
|
|
icon=""
|
|
;;
|
|
5)
|
|
icon=""
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
if [[ "$state" == "Not charging" ]]; then
|
|
icon=""
|
|
fi
|
|
|
|
if [[ "$state" == "Full" ]]; then
|
|
icon=""
|
|
status="Full"
|
|
fi
|
|
|
|
if [[ "$state" == "Charging" ]]; then
|
|
icon=""
|
|
fi
|
|
|
|
echo "$icon $status"
|