46 lines
698 B
Bash
Executable File
46 lines
698 B
Bash
Executable File
#!/bin/bash
|
|
|
|
icon=""
|
|
|
|
IFS=" " read -ra parts <<< "$(bash-status-bat)"
|
|
|
|
parts_0=${parts[0]}
|
|
current=${parts_0//\%/}
|
|
state=${parts[1]}
|
|
status="$current%"
|
|
|
|
if [[ "$state" == "discharging" ]]; then
|
|
case $((current/20+1)) in
|
|
1)
|
|
icon=" "
|
|
;;
|
|
2)
|
|
icon=" "
|
|
;;
|
|
3)
|
|
icon=" "
|
|
;;
|
|
4)
|
|
icon=" "
|
|
;;
|
|
5)
|
|
icon=" "
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
case $state in
|
|
not-charging)
|
|
icon=" "
|
|
;;
|
|
fully-charged)
|
|
icon=" "
|
|
status="Full"
|
|
;;
|
|
charging)
|
|
icon=" "
|
|
;;
|
|
esac
|
|
|
|
echo "$icon $status"
|