I38/scripts/battery_status.sh

10 lines
279 B
Bash
Raw Normal View History

2022-11-30 09:11:51 -05:00
#!/bin/env bash
#Get battery status
cd /sys/class/power_supply
for f in `ls`; do
if [ -e $f"/capacity" ]; then
export stat=`cat $f"/status"`
export cap=`cat $f"/capacity"`
echo battery $f": "$stat", "$cap"%"
fi
done|zenity --text-info --filename=/dev/stdin --title "Power Status"