Closed luchofariello closed 7 years ago
Hello @luchofariello it looks like your script is ran using an account without access to the NSNotificationCenter. Maybe answers to this issue can help https://github.com/julienXX/terminal-notifier/issues/145#issuecomment-166856810 ?
Yup .. Make sure you are running it as you and to keep it simple, have it run a script that you own. I do this myself. If you need it to run through sudo, just modify /etc/sudoers (visudo) to authorize your userid (via the admin group per below) to run the commands that you need. ie
%admin ALL=(ALL) ALL, NOPASSWD: /sbin/mount, /sbin/umount, ...
Hi
Tried again but I had the same error, run it as /Library/LauchAgents and I already have the line in the sudoers.
User ALL = (ALL) ALL, NOPASSWD: ALL
If I run it with sudo -u user terminal-notifier I have the same error but only if I run it with lauchctl. Being sudo and running the command manually with sudo -u user works correctly. I also tried to execute LauchDaemon with the key username but I have the same error.
do you have any other ideas?
Thank you for your help.
sorry, sudoer line
user ALL=(ALL) NOPASSWD: ALL
I would move the command to a script owned by user and have launchctl run the script.
Your example /Users/user/terminal-notifier -title "title" -subtitle "subtitle" -message "message" -actions "actions1","actions2" -dropdownLabel "dropdownLabel" -appIcon pathalert.icns -sound "frog" -timeout 120
Where are your actions defined? You mentioned sudo, but your command doesn't reflect the command. Is terminal-notifier located in your parent directory? Also, I would not run terminal-notifier as an alert or wait for a response in launchctl without having the command be run as a background process (& at the end)
Perhaps you should try running it as a Launch Agent?
Shannon
On 23 May 2017 at 04:33, luchofariello notifications@github.com wrote:
@julienXX https://github.com/julienxx hi julien,
I run a process from launchctl (LaunchDaemon) and it gives me error: 2017-05-22 15: 16: 48.109 terminal-notifier [35828: 581946] NSNotificationCenter connection invalid 2017-05-22 15: 16: 48.109 terminal-notifier [35828: 581946] Connection to notification center invalid. ServerConnectionFailure: 1 invalidated: 0
I am executing it like this: /Users/user/terminal-notifier -title "title" -subtitle "subtitle" -message "message" -actions "actions1","actions2" -dropdownLabel "dropdownLabel" -appIcon pathalert.icns -sound "frog" -timeout 120
If I run it directly manual it works correctly.
mac-version: 10.12.3 terminal-notifier-version: 1.8.0
Thank you very much, I hope to answer.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/julienXX/terminal-notifier/issues/220, or mute the thread https://github.com/notifications/unsubscribe-auth/AYPvHINhDoCr9Et-4D2xX8n4CWujmvfNks5r8dT0gaJpZM4NiuW- .
-- Mr Shannon Pasto SOE Engineer (OS X)
Monash University eSolutions - Device Solutions 700 Blackburn Rd Notting Hill VIC 3168
T: +61 (0)3 990 32914 E: shannon.pasto@monash.edu W: monash.edu http://www.monash.edu/
Twitter/MonasheSol https://twitter.com/intent/user?screen_name=monashesol eSolutions Live – Self Help Central https://sites.google.com/a/monash.edu/esolutions/
I have the same issue, but only if I'm running in tmux. Are you using tmux?
Same here, the problem shows up only in tmux ... any fix for this?
Same problem when using tmux
tmux issue +1
I see error when using Tmux
Still not using tmux so I won't be able to help here. Please refer to the previous tmux issues, closing this one for now.
@julienXX hi julien,
I run a process from launchctl (LaunchDaemon) and it gives me error: 2017-05-22 15: 16: 48.109 terminal-notifier [35828: 581946] NSNotificationCenter connection invalid 2017-05-22 15: 16: 48.109 terminal-notifier [35828: 581946] Connection to notification center invalid. ServerConnectionFailure: 1 invalidated: 0
I am executing it like this: /Users/user/terminal-notifier -title "title" -subtitle "subtitle" -message "message" -actions "actions1","actions2" -dropdownLabel "dropdownLabel" -appIcon pathalert.icns -sound "frog" -timeout 120
If I run it directly manual it works correctly.
mac-version: 10.12.3 terminal-notifier-version: 1.8.0
Thank you very much, I hope to answer.