Skip to content

Instantly share code, notes, and snippets.

@thameera
Last active December 15, 2015 07:59
Show Gist options
  • Save thameera/5228000 to your computer and use it in GitHub Desktop.
Save thameera/5228000 to your computer and use it in GitHub Desktop.
Small bash script I use to create timers from the terminal. Place it in your $PATH. When the alarm goes, a message is printed on terminal, a beep sound is played, a native notification is displayed and a message box pops up.
#!/bin/bash
# USAGE
# timer <time> <optional message>
# timer 15 You've lived enough. Go die!
echo "Will go off in" $1 "minutes..."
sleep $(($1*60))
shift
echo "Time's up!"
mplayer /usr/share/sounds/gnome/default/alerts/drip.ogg &>/dev/null
notify-send 'Timer' "$*"
zenity --info --title "Timer" --text "$*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment