scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit e9a6176d1249f8783c1769570ebfceec39eecd73
parent 37251e5a3f673d3bcf147f4f11c922157ce3482c
Author: z3bra <willy@mailoo.org>
Date:   Thu Apr  3 10:37:01 +0200

Now beep put the sound on

Diffstat:
battery.sh | 19++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/battery.sh b/battery.sh @@ -8,7 +8,20 @@ BATS=`cat /sys/class/power_supply/BAT1/status` # Run this if sound is enabled sbell () { + IFS=' %' read level state <<< `~/bin/volume` + + ~/bin/volume unmute + ~/bin/volume '80%' + beep -f 1000 -l 200 -D 50 + + case $state in + on) ~/bin/volume unmute;; + off) ~/bin/volume mute;; + esac + + # reset volume to its previous state + ~/bin/volume "${level}%" } # and this in case of no sound enabled @@ -35,8 +48,8 @@ test "$#" -lt 3 && usage # if battery is charging, do not alert user test "$BATS" == "Charging" && exit -test $BATC -lt $1 && sbell # one bip for level <low> -test $BATC -lt $2 && sbell # two bip for level <critical> -test $BATC -lt $3 && sbell # battery is <dead>, bip 3 times +test $BATC -lt $1 && sbell # one bip for level <low> +test $BATC -lt $2 && sbell # two bip for level <critical> +test $BATC -lt $3 && sbell # battery is <dead>, bip 3 times test $BATC -lt $1 && vbell # popup a notification under <low> level