Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a script to update my package manager and post a notification via terminal-notifier. When run manually, it works fine, but when called via launchd (local to the user, in ~/Library/LaunchAgents/), terminal-notifier seemingly doesn't start. It doesn't hang, however; later parts of the script run as expected. Nothing is produced on stdout/stderr. I'm using absolute paths in everything, so that's not the problem either in terms of manual vs. launchd execution. I'm fairly sure this is just another stupid quirk of launchd, but is there any way to overcome it?

Launchd agent

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

The relevant line of code in

/usr/local/bin/terminal-notifier -title "Homebrew updates" -sound default
share|improve this question

I was having this same problem and couldn't figure it out either. I finally remembered reading in terminal-notifier's README.markdown that:

In order to use terminal-notifier, you have to call the binary inside the application bundle.

So I edited my script to call /Applications/ instead of /usr/local/bin/terminal-notifier and that took care of the problem. While the /usr/local/bin/ executable works fine when the script is called from the interactive shell, for some reason launchd needs to use the version encapsulated inside /Applications/ to work properly.

(Note that if you install terminal-notifier with Homebrew, you'll have to make sure to run brew linkapps to create the necessary symlink in your Applications folder, per brew info terminal-notifier.)

share|improve this answer
This way terminal-notifier still shows nothing :( – ddmytrenko Oct 20 '15 at 8:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .