Skip to content

Instantly share code, notes, and snippets.

@rayners
Last active August 29, 2015 13:56
Show Gist options
  • Save rayners/9232286 to your computer and use it in GitHub Desktop.
Save rayners/9232286 to your computer and use it in GitHub Desktop.
Water reminder as a service
  • Growl (App Store) and growlnotify need to be installed
  • Install drink_reminder somewhere
  • Change the path in org.rayners.drinkReminder.plist to point to wherever you installed drink_reminder (and be sure to chmod a+x drink_reminder so it can be executed)
  • Place org.rayners.drinkReminder.plist in ~/Library/LaunchAgents and load with launchctl load ~/Library/LaunchAgents/org.rayners.drinkReminder.plist
  • Drink
#!/bin/sh
/usr/local/bin/growlnotify -s -m "Drink water" -n "Water Reminder"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.rayners.drinkReminder</string>
<key>ProgramArguments</key>
<array>
<string>/Users/rayners/bin/drink_reminder</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>7200</integer>
<key>StandardErrorPath</key>
<string>/tmp/drink.err</string>
<key>StandardOutPath</key>
<string>/tmp/drink.out</string>
</dict>
</plist>
@jjulian
Copy link

jjulian commented Feb 26, 2014

Can Growl be bypassed and notifications just sent to the Notification Center?

@flipsasser
Copy link

No.

@rayners
Copy link
Author

rayners commented Feb 27, 2014

Recent versions of Growl can forward to Notification Center.

@rayners
Copy link
Author

rayners commented Feb 27, 2014

I've also been looking for an excuse to learn ObjC. A native notification center app might be it.

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