Added a script to check battery status
This commit is contained in:
parent
be77a6a383
commit
9651ff906c
10
scripts/battery_status.sh
Normal file
10
scripts/battery_status.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/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"
|
Loading…
Reference in New Issue
Block a user