7 lines
204 B
Bash
7 lines
204 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
percent=$(cat /sys/class/power_supply/BAT0/capacity)
|
||
|
charging=$(cat /sys/class/power_supply/BAT0/status | grep "^C")
|
||
|
[ -z "$charging" ] && status=" " || status="*"
|
||
|
echo $percent"% [$status]"
|