14 lines
323 B
Shell
Executable file
14 lines
323 B
Shell
Executable file
status=$(cat /sys/class/power_supply/BAT0/status)
|
|
level=$(cat /sys/class/power_supply/BAT0/capacity)
|
|
|
|
case $status in
|
|
Full)
|
|
echo $level%o
|
|
;;
|
|
Charging)
|
|
echo $level%+
|
|
;;
|
|
Discharging)
|
|
echo $level%-
|
|
;;
|
|
esac
|