Updated the battery status script.
This commit is contained in:
parent
bd88e966de
commit
f87f2e4268
@ -1,10 +1,13 @@
|
|||||||
#!/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#Get battery status
|
|
||||||
cd /sys/class/power_supply
|
find /sys/class/power_supply -type l -exec bash -c '
|
||||||
for f in `ls`; do
|
for i ; do
|
||||||
if [ -e $f"/capacity" ]; then
|
if [[ -e "$i/capacity" ]]; then
|
||||||
export stat=`cat $f"/status"`
|
bat="${i##*/}"
|
||||||
export cap=`cat $f"/capacity"`
|
bat="${bat//BAT/Battery }"
|
||||||
echo battery $f": "$stat", "$cap"%"
|
bat="${bat}: $(cat "${i}/capacity") percent"
|
||||||
|
spd-say -P important -Cw "$bat"
|
||||||
fi
|
fi
|
||||||
done|spd-say -e
|
done
|
||||||
|
' _ {} \;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user