18 lines
277 B
Bash
Executable File
18 lines
277 B
Bash
Executable File
#!/bin/bash
|
|
|
|
STATUS="/sys/class/power_supply/BAT1/status"
|
|
BAT="/sys/class/power_supply/BAT1/capacity"
|
|
|
|
if [ ! -f "$STATUS" ] || [ ! -f "$BAT" ]; then
|
|
exit
|
|
fi
|
|
|
|
OUTPUT="♥ "
|
|
|
|
if [ "$(cat $STATUS)" == "charging" ]
|
|
then
|
|
OUTPUT="$OUTPUTl"
|
|
fi
|
|
|
|
echo " | $OUTPUT$(cat $BAT)%"
|