Skip to content
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

Add OS X Notification Center notification backend support #39

Open
morgant opened this issue Feb 24, 2015 · 7 comments
Open

Add OS X Notification Center notification backend support #39

morgant opened this issue Feb 24, 2015 · 7 comments

Comments

@morgant
Copy link

morgant commented Feb 24, 2015

Pull Request #30 added support for OS X Notification Center (OS X 10.8 Mountain Lion and newer) using terminal-notifier. Unfortunately, it also added GitHub-specific support, so was not accepted, but the OS X Notification Center support would be a nice addition.

@ku1ik
Copy link
Owner

ku1ik commented Feb 25, 2015

Feel free to send a pull-request then :)

@joshdick
Copy link
Contributor

FWIW, I was able to accomplish this via the following (no external packages):

git config --global dude.notify-command 'osascript -e "display notification \"$DESCRIPTION\" with title \"$TITLE\""'

@ku1ik
Copy link
Owner

ku1ik commented Oct 15, 2015

We have 2 options then:

  • add osascript support to the code,
  • or document the above example in the readme

@joshdick
Copy link
Contributor

I believe the osascript support for notifications was added in OS X Mavericks. terminal-notifier or Growl would still be necessary for earlier versions of OS X.

@digitaljhelms
Copy link

Using git config per @joshdick didn't work for me, not sure what's up, getting a "Service exited with abnormal code" in the logs when I run this as a LaunchAgent daemon...

@joshdick
Copy link
Contributor

joshdick commented Nov 3, 2015

@digitaljhelms Which version of OS X are you using? This has worked fine for me on both Yosemite and El Capitan.

@digitaljhelms
Copy link

@joshdick El Capitan (10.11.1)

Command line failure: 732:742: syntax error: A identifier can’t go after this “"”. (-2740)

I walked through a few repos symlinked in ~/.git-dude and ran git dude manually until I found the repo causing the error. While, I don't know the specific commit that's the culprit, I can speculate it has something to do with a double quote in the description or title that, if not escaped before being passed to the osascript command, causes the error... Perhaps working an escaping solution into the notify command (something like http://stackoverflow.com/a/23923108) would resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants