Skip to content

Instantly share code, notes, and snippets.

@drazulay
Last active September 7, 2023 08:43
Show Gist options
  • Save drazulay/b2c1b1bde7ebf21e328c5ccbb1bf60b5 to your computer and use it in GitHub Desktop.
Save drazulay/b2c1b1bde7ebf21e328c5ccbb1bf60b5 to your computer and use it in GitHub Desktop.
A terminal alias implementing an alarm clock.
# Usage: wekker 21:04 /path/to/audiofile.mp3.
# Add this to your ~/.profile or wherever you store your aliases.
# You could run it from crontab.
alias wekker='_wekker(){ printf "you will be woken up at %s with audio file %s\n" "$1" "$2"; while [ 1 ]; do; date "+%H:%M" | grep -q "$1"; [[ $? -eq 0 ]] && open -a VLC "$2" && break || sleep 1; done; }; _wekker'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment