The base configuration for my FVWM setup. Includes core modules, logic, and functionality.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
595 B

while true
do if [ -e /sys/class/power_supply/BAT1/capacity ] # Do we have a battery to monitor?
then sleep 60
x=`cat /sys/class/power_supply/BAT1/capacity`
if [ $x -le 25 ] # When do we notify the user?
do aplay $FVWM_USERDIR/sounds/CritNotif.wav &
printf "Battery alert!\nYour battery only has a remaining capacity of $x%!" | xmessage -file - -center
sleep 300 # Don't spam the user!!!
x=`cat /sys/class/power_supply/BAT1/capacity` # Obtain new value.
else exit