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