#!/bin/sh while true do sleep 60 x=`cat /sys/class/power_supply/BAT1/capacity` while [ $x -le 25 ] do aplay $FVWM_USERDIR/sounds/CritNotif.wav & printf "Battery alert!\nYour battery only has a remaining capacity of $x!" | xmessage -file - -center done done