cortesi / modd

A flexible developer tool that runs processes and responds to filesystem changes
MIT License
2.8k stars 128 forks source link

Further information on Growl for Mac OSX #59

Open tomspeak opened 6 years ago

tomspeak commented 6 years ago

MacOS: 10.14

I am trying to get Growl to work. I have installed Growl from the App Store, and installed the command line utility growlnotify, and verified it works.

When running modd -n — I never seem to be able to trigger a notification.

My modd file is as follows:

cmd/**/*.go pkg/**/*.go {
    prep: go build -o test ./cmd/web/...
    daemon +sigterm: ./test
}

This works as intended, but lacks notifications — any ideas?

ernstki commented 3 years ago

I myself was somewhat confounded by this. As Growl's "retirement" was announced recently, maybe it's time to just use osascript to send a native notification with AppleScript:

Bildschirmfoto 2021-01-06 um 10 48 49_thumb

$ osascript -e 'display notification "The command finished" with title "Success"'

I'm willing to do the PR for that, but it would be good if somebody (@tomspeak?) would be willing to test the patch on a fancy new version of macOS, as I can only test as far back as Mavericks and as far forward as Mojave. I assume the API as it were is pretty stable, since Notification Center was announced almost a decade ago, but who ever knows.

hat tip: https://dev.to/bphogan/how-to-use-macos-notifications-with-your-command-line-programs-ma4