Skip to content

isotopic/notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

Notify

Quick and dirty way to dispatch OSX notifications from bash scripts and cronjobs.

Note: In most linux distros you can have this same functionality by using notify-send "Title" "Message here"

Direct call examples:

$ notify "Title"
$ notify "Title" "Message here"

Install

$ cd /usr/local
$ git clone https://github.com/isotopic/notify.git
$ chmod u+x notify/notify.sh
$ ln -s /usr/local/notify/notify.sh /usr/local/bin/notify

If you're not the owner of /usr/local, you may need to $ sudo chown -R YOURUSERNAME notify

Cronjob usage example:

$ crontab -e
20 16 * * * /usr/local/bin/notify "Hey!" "Stop what you're doing and do that other thing instead"

Note: Cron has a limited set of env vars so we have to pass the absolute path to the script.

Notes

By default, Apple script notifications are automatically dismissed after some seconds. In order to keep them on until you dismiss them manually, set 'Alerts' in:

System Preferences > Notifications > Script Editor > Script Editor alert style: Alerts

Todo

  • Correctly escape special characters like exclamation marks.

About

Dispatch OSX notifications from bash scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages