terminal-notifier icon indicating copy to clipboard operation
terminal-notifier copied to clipboard

Does it work with the "at" command?

Open for-coursera opened this issue 10 years ago • 8 comments

Something like echo 'terminal-notifier -title "TV" -message "Superman"' | sudo at 1305 produces just nothing... But may be there's some other way?

(Or may be it's just me, and something like the above works for others just fine?)

for-coursera avatar Oct 17 '15 10:10 for-coursera

Looks like at is somewhat disabled on OSX, that must be the issue here.

julienXX avatar Nov 05 '15 17:11 julienXX

Did you find a way? I am struggling on the same problem. "at" runs fine with other commands. terminal-notifier denies to deliver the notification. I only see terminal-notifier[xxxx]: ApplePersistence=NO in the syslog.

kolydart avatar Jul 03 '16 20:07 kolydart

I am having a similar issue the error output from trying to run terminal-notifier in a script called by an at command


2017-05-08 03:05:02.713 terminal-notifier[2884:28175] NSNotificationCenter connection invalid
2017-05-08 03:05:02.725 terminal-notifier[2884:28175] Connection to notification center invalid. ServerConnectionFailure: 1 invalidated: 0
2017-05-08 03:05:02.726 terminal-notifier[2884:28175] Connection to notification center invalid. ServerConnectionFailure: 1 invalidated: 0

It is not a problem with at jobs not successfully running in mac https://superuser.com/questions/43678/mac-os-x-at-command-not-working I ran the fix here and can run an at job with other files it just doesn't work specifically with this one

This is my call to terminal notifier which is inside a file that i directed the at command to execute

export DISPLAY=/private/tmp/com.apple.launchd.5jte4rZAmH/org.macosforge.xquartz:0
terminal-notifier -title "Insomnia" -message "Time to take a rest"  -sound "default"  -group rest -timeout 7 -appIcon sleep.png 2> ~/git/darwin.log

alexanderepstein avatar May 08 '17 07:05 alexanderepstein

I found a way arround this by using reattach-user-to-namespace found in homebrew. When using at what happens is the command or file is ran with some weird permissions by using the tool above it ties you with ur current terminal namespace and therefore it has all the necessary permissions

alexanderepstein avatar Jun 27 '17 04:06 alexanderepstein

Homebrew also let's you install at

alexanderepstein avatar Jun 27 '17 04:06 alexanderepstein

@alexanderepstein: Can you post an example of how to successfully combine reattach-to-user-namespace, terminal-notifier and at?

forthrin avatar May 14 '19 06:05 forthrin

I thought I was discovering a brand new bug considering the lack of documentation for using notifications with at, but I'm glad to see this issue!

The workaround suggested in https://github.com/julienXX/terminal-notifier/issues/144#issuecomment-311246686 seems to work.

@for-coursera @forthrin @annidy I'm adding a short example here, hope this helps.

brew install reattach-to-user-namespace
echo 'reattach-to-user-namespace terminal-notifier -title "Title" -message "Example message"' | at now + 1 minute

pjg11 avatar Jul 06 '23 00:07 pjg11

at is getting more and more difficult to use with macOS. If anyone knows a simple solution to scheduling tasks that doesn't involve XML or while/sleep loops, post here.

forthrin avatar Jul 09 '23 07:07 forthrin