6

I need a way to have a Linux-based machine send a message that can be received and displayed by the Mavericks Notification Center. I used to do this on an older version of OS X by running Growl, and using its built-in ability to listen for incoming notifications. On the Linux box, I run a Perl script that uses the Net:Growl module to send the notifications. This was simple and worked well, but since everything is moving from Growl to Notification Center I'd like to be able to use that under Mavericks.

As far as I can tell, Notification Center has no way to receive incoming messages from another system on the network and post them. Is there really no way to do that, or am I just missing it?

My other thought was that if I could send the message as a Bonjour message then iChat could display it, but I don't know of any way to have a script send a Bonjour message from a Linux box. Note that the Linux box is a server, and therefore has no desktop or GUI.

I was hoping that perhaps someone else has run into this and has figured out a way to push notifications from another machine on the local network and display them in Notification Center. If so, would you please be so kind as to tell me how you did it, or perhaps point me to a useful page that explains the procedure?

2

You could ssh to the destination machine and run the following for each notification.

osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"'

Alternatively, there are a number of ways of running AppleScript remotely. You can do it with Keyboard Maestro, which allows you to run macros (that can run AppleScript) over the network:

  • This looked like a great solution until I found out they want $36 for a license. I was really hoping for a free solution, and since I would have no use for that program other than for receiving the notifications, AND I would still have to write my own macro and/or AppleScript, I don't want to go that route. As for SSH, I was aware of that but was hoping not to have to open up SSH access for security reasons, since SSH is the target of so many attacks. – Guest Mar 9 '14 at 21:00
1

EDIT: I missed that you want a linux based machine as your source. The following is Mac to Mac using Applescript:

tell application "Finder" of machine "eppc://UserName:Password@Computer.local"
        display notification "This is the message body." with title "Message Title" with subtitle "Message Subtitle"
end tell

Applescript. No need for Growl. Depending on notification settings this will either display for a couple seconds and then disappear or it will stay on the screen until the user clicks "Close"

You must log in to answer this question.

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