-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage in a bash script #148
Comments
My guess is that when using launchd, you don't get access to the graphical part of the user's account and therefore can't access the Notification Center. |
I use a separate launch Agent to execute the terminal-notifier. That works great.
|
@applebit924 nice, could you post your solution here? |
Create the LaunchAgent /Library/LaunchAgents/com.AppleBitTechnologies.coreMonitor.plist with the following contents: Label com.AppleBitTechnologies.coreDaemon KeepAlive Program /Library/Scripts/coreDaemon/System/coreMonitor.sh WatchPaths /tmp/.coreMonitor——————————————————————————————— Then your launch daemon can use something of this nature to get the job done: NC_UID=$(ruby -e 'puts Time.now.to_f') message="MESSAGE EXAMPLE" echo '"'"/Library/Scripts/coreDaemon/Components/Locally-Installed/Software_Updates/Data/Applications/Software Update Notifications.app/Contents/MacOS/Software Update Notifications"'" -message "'"$message"'" -title "'"$title"'" -group "'"$group"'" ' > /tmp/.coreMonitor-NotificationCenter-$NC_UID.sh ——————————————————————————————— Can someone please publish this as well? I’ve been meaning to but so darn busy.
|
Thanks for everyone's contribution. I got it working by specifying the full path of |
I try to use
terminal-notifier
inside a bash script. When I call the script in a terminal manually, it works fine. However, if the script is called outside of a terminal, e.g. bylaunchd
, then no notification appears.Is this by design or am I missing something here?
The text was updated successfully, but these errors were encountered: