Guest User

thetrojan01 - tea counter

a guest
Mar 18th, 2011
152
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. if [ -z "$1" ] ; then
  4.     echo "Usage: $0 <time in minutes>";
  5.     exit
  6. fi
  7.  
  8. BASEPATH="/usr/bin"
  9.  
  10. if [ ! -x "$BASEPATH/xmessage" ] ; then
  11.     echo "Please install xorg/xmessage to run this script.";
  12.     exit;
  13. fi;
  14.  
  15. sleep "$1m";
  16. SOUND='/usr/share/sounds/phone.wav';
  17. aplay $SOUND &> /dev/null;
  18.  
  19. RET=`xmessage -buttons OK:0,'30sec more':1 'Tea is Ready!' -center -print`;
  20.  
  21. while [ "$RET" != "OK" -a -n "$RET" ] ; do
  22.     sleep 30s;
  23.     aplay "$SOUND" &> /dev/null ;
  24.     RET=`xmessage -buttons OK:0,'30sec more':1 'Tea is Ready!' -center -print`;
  25. done;
RAW Paste Data