Skip to content

Instantly share code, notes, and snippets.

@pplantinga
Created May 23, 2013 21:02
Show Gist options
  • Save pplantinga/5639393 to your computer and use it in GitHub Desktop.
Save pplantinga/5639393 to your computer and use it in GitHub Desktop.
Want to set an alarm via OS X terminal? It's easy, just use this!
#!/bin/bash
# Simple script for setting an alarm on Mac OS X
# Arguments are ./alarm.sh {hour} {minute}
until [ `date "+%H"` -eq $1 ] && [ `date "+%M"` -eq $2 ]; do
sleep 10
done
osascript -e 'set volume 7'
say -v Trinoids "WARNING WARNING WARNING"
@pplantinga
Copy link
Author

On an Ubuntu-flavored machine, the last two lines could be changed to:

amixer -c 0 set Speaker 100%
espeak "WARNING WARNING WARNING"

Though no promises that it works on your particular machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment