6 lines
204 B
Bash
Executable file
6 lines
204 B
Bash
Executable file
#!/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]"
|