Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frigginglorious/4772bcc3d685ca9e7b798d1d35ca5b3c to your computer and use it in GitHub Desktop.
Save frigginglorious/4772bcc3d685ca9e7b798d1d35ca5b3c to your computer and use it in GitHub Desktop.
timer script. Accepts one argument, time in seconds before alarm goes off.
#!/bin/bash
seconds=$1; date1=$((`date +%s` + $seconds));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)\r";
done
aplay /usr/share/sounds/alsa/Front_Center.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment