julienxx / terminal-notifier Goto Github PK
View Code? Open in Web Editor NEWSend User Notifications on macOS from the command-line.
License: Other
Send User Notifications on macOS from the command-line.
License: Other
Hi,
Great tool! I'd love to see support for specifying a subtitle for the NSUserNotification object, though. I'd add it myself and do a pull request, but I have no way of testing the code due to the whole bundle-signing issue...
Hi,
thanks for that very useful tool. Do you think it's possible to change the icon in the notification?
Cheers!
Pv
Is it possible to change the group title used for notifications from terminal-notifier
to Terminal Notifier
? This is shown both as the group heading in Notification Center and in the Notifications system preferences pane. Even better would be the ability to set this via a command line switch. I have no motivation for this change other than that terminal-notifier
is just so ugly.
I skimmed through the project but can’t immediately see where it’s coming from. Is there a limitation that this string simply comes from the name of the binary sending the notifications?
Other than that this gem is awesome.
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.
When I try to load up the project file in OS X Mavericks DP6 (Xcode 5 DP6) It crashes Xcode. I have a bug report in with Apple about the crash, but I thought I would add one here as well to make you aware of the problem.
BTW, this also crashes when doing a brew install of terminal-notifier 1.5.0
brew upgrade
==> Upgrading 1 outdated package, with result:
terminal-notifier 1.5.0
==> Upgrading terminal-notifier
==> Downloading https://github.com/alloy/terminal-notifier/archive/1.5.0.tar.gz
==> xcodebuild -project Terminal Notifier.xcodeproj -target terminal-notifier SYMROOT=build -verbose
29 0x0000000105b1cdb6 -[Xcode3CommandLineBuildTool _resolveInputOptionsWithTimingSection:](in Xcode3Core)
30 0x0000000105b29340 -[Xcode3CommandLineBuildTool run](in Xcode3Core)
31 0x0000000104ed39b0 (in xcodebuild)
32 0x00007fff82bfb5fd start (in libdyld.dylib)
33 0x0000000000000007
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Currently (1.4.2), usage information is only printed when an invalid set of parameters is encountered.
It would be nice if the application properly supported a mechanism specifically for invoking usage information: either -h
or --help
by convention.
The exit code should be set to zero in that event.
This would be much more flexible than bundle IDs for applications which support custom url schemes.
Hi!
First of all, thanks for the great tool! However, I've discovered a small bug. When you pass in a message that doesn't start with an alphanumeric character, the message becomes null and the app doesn't deliver the notification:
wouter@mini-me:~$ terminal-notifier -title irssi -message '[foo]'
terminal-notifier (1.3.0) is a command-line tool to send OS X User Notifications.
...
I've tested this with a bunch of chars and it seems something is wrong in the Objective-C code. The ruby part seems to pass things on nicely, but I have no clue how to fix this on the objective-c side :)
Keep up the good work!!
Wouter
login on macOs as userOne
open a terminal and run "su - userTwo" to for a shell prompt as userTwo
try terminal-notifier -message Hello
at this point terminal-notifier hangs
I'd rather have the command fail (quickly) and the script to move on rather than the script hanging
Is t possible to hide this output from terminal window?
Hey, it would be great if we could have a method of removing a notification we've sent earlier, possibly using the group id to disambiguate which notification we're talking about.
Is this something that is possible/easy to do?
I don't know if apples API's allow for it, and I didn't see anyone else ask yet, but it would be great if an option was added to make the notification 'sticky' like the Reminders.app can do. I assume it would be based on the group id, but that group id would stay on screen until the user dismissed it. Is this possible?
Font-Awesome has ttf/svg icons that are freely available.
I have no idea, which is why I'm asking, is it possible to integrate the font-awesome subset, and present it via a -fontawesome icon-uparrow
or some variant?
For example, I have a LaunchDaemon that calls a script. The script runs as root. When the script completes, I would like to have it post a notification. However, calling terminal-notifier from this script appears to fail.
Exploring further, I switched to root (sudo su -
) and tried running terminal-notifier directly; it simply hung, and never returned to the command prompt.
Then, still as root, I tried calling terminal-notifier via sudo (sudo -u the_current_user terminal-notifier
), but got the same result.
Is this a mistake on my part, an issue in terminal-notifier, or a restriction in Notification Center?
I'm not sure if this is a bug or not, but I figured you guys might be able to help me figure out why this is happening.
I have bash hooks setup to notify me when long-running commands finish. (E.g. if a bash command takes longer than 30 seconds, it pops up a notification when it finishes) Clearly, these notifications can clutter up my notification center, so I have all these notifications set to have a group id of "$$"
, that is, the process id of the bash shell they're started from. Then, when that bash shell exits, it clears all the notifications.
Now I'm seeing some interesting behavior from a very specific method of calling terminal-notifier -remove
. If I call:
$ terminal-notifier -remove "$$" &
Everything works as it should. The notification is cleared (I background the task so that my work in the shell is impacted minimally). If instead, I call:
$ ( terminal-notifier -remove "$$" & )
The notification is removed, however immediately after that I get another notification with the title set to "Terminal" and no message. This happens even if I don't have a notification to remove. Any ideas why launching this command in a subshell would have an effect?
Option arguments that start with certain characters currently (1.4.2) break invocation of terminal-notifier
:
terminal-notifier -message "-hello, world"
(
, '<', '{', '[' (possibly others); e.g.:terminal-notifier -message "(hello, world)"
terminal-notifier -message "<hello, world>"
terminal-notifier -message "{hello, world}"
terminal-notifier -message "[hello, world]"
Hi,
I use the open option to open a URL after clicking on the notification. The URL I've specified should do a search eg. via amazon with the notification title eg. a movie name. I found that if the search string consists of several words seperated by spaces the URL is not opened. As the search string is provided by another application I'm not able to replace the spaces by %20.
Example:
/Applications/Utilities/terminal-notifier.app/Contents/MacOS/terminal-notifier -message "a test" -open "http://www.amazon.com/s?ie=UTF8&field-keywords=a test"
Fails with message:
18.08.12 10:04:56,545 terminal-notifier[3567]: open: http://www.amazon.com/s?ie=UTF8&field-keywords=a test
18.08.12 10:04:56,546 com.apple.launchd.peruser.501[225]: ([0x0-0x3bf3bf].nl.superalloy.oss.terminal-notifier[3567]) Exited with code: 1
I tried 'a test' but got the same result, tried "a test" but then only the "a" was searched.
Edit: I managed to get the search string UTF8 encoded, so the space is replaced by +, the result is still the same.
18.08.12 11:06:36,591 terminal-notifier[480]: open: www.amazon.com/s?ie=UTF8&field-keywords=a+test
18.08.12 11:06:36,592 com.apple.launchd.peruser.501[233]: ([0x0-0x43043].nl.superalloy.oss.terminal-notifier[480]) Exited with code: 1
Thanks in advance for any help.
echo Hello | terminal-notifier
would be equivalent to
terminal-notifier -message Hello
Kudos for great job!
Currently the Notifications are delivered using a UUID generated on notification.
I'd like it to use a UUID generated/given to the notification from whatever script called the notification.
The reason being, that you could then script the Notification's behaviour.
The idea would be to add a -UUID flag.
MORE INFO:
The users Notification Center DB is held here: ~/Library/Application Support/NotificationCenter/.db.. This is an SQLite DB.. If you dig around you can find the app_id associated by the users notification center for terminal notifier.. with that you can run something like the below, to show the notification as an Alert (therefore staying on screen).
sqlite> INSERT OR REPLACE INTO notifications VALUES ( '<row_number>', '<notification_UUID', '<app_id>' , 'bplist00?23X$versionX$objectsY$archiverT$top' );
The bplist00?23 value changes the notification type & if it's shown in notification centre.
For example, if the -sender is com.apple.iTunes, iTunes will be given focus (become frontmost), but it won't be maximized if iTunes is minimized.
terminal-notifier -message "test" -sender com.apple.iTunes
terminal-notifier -message "test" -activate com.apple.iTunes
Current outcome:
On clicking the notification, the sender is left minimized, though it gains focus
Expected outcome:
On clicking the notification, the sender is maximized if minimized
Currently, all notifications will show up under "terminal-notifier", it would be nice to be able to set where the notification is coming from. For example, if I set it up with geektool, it would be nice to have it say "Geektool" instead of terminal-notifier. This would make it easier to distinguish between notifications in notification centre.
Could you share a quick example of how to format open URL
— I think my syntax is not correct?
For example:
# ./terminal-notifier.app/Contents/MacOS/terminal-notifier -message "Hello" -open "https://github.com/alloy/"
shows a dialog with an error "You can't open the application terminal-notifier" because it may be damaged or incomplete."
*It shows the notification just fine; the error happens when I click the notification. thanks!
I've noticed that terminal-notifier has started hanging recently. Maybe it's related to 10.8.3 which came down the pipe recently?
I put a sample from the hang into a gist:
I recently updated to OS X 10.8.4 and the -open flag broke. Running this command:
./terminal-notifier.app/Contents/MacOS/terminal-notifier -message test -open test
and clicking on the notification now gives me this error message:
You can’t open the application “terminal-notifier.app” because it may be damaged or incomplete.
This is both with the prebuilt binary and with the binary I built myself.
An optional parameter for passing a notification specific icon would allow scripts/apps to better customize their notification's appearance.
No feedback from the terminal to indicate why (are there log files somewhere)?
A call to -list ALL
shows that my message was delivered.
Any way I can help debug it?
Let's be an honest, I'm a script kiddy and haven't been able to get this to work. One example would be awesome
Thanks!
My command is:
terminal-notifier -message 'Some text' -title 'Some title' -sender com.apple.iTunes -activate com.apple.iTunes
Notification is shown but clicking it does nothing and notifications doesn't disappear.
Console.app shows:
15/10/13 18:31:59,865 usernoted[189]: Cannot find originating application to launch for event action. file:///Applications/iTunes.app/ is not the same app as the one that sent the original notification.
15/10/13 18:31:59,865 usernoted[189]: Error finding application com.apple.iTunes.
Hi. This is more of a XCode question. I cloned your repo and try to build with a custom icon, and got
Code Sign error: The identity 'Developer ID Application: Fingertips B.V.' doesn't
match any valid, non-expired certificate/private key pair in your keychains
Do I really have to pay the $99 for developer program just to build an app locally?
in Ruby 1.9.3 (here: https://github.com/alloy/terminal-notifier/blob/master/Ruby/lib/terminal-notifier.rb#L20 )
Removing the star works:
IO.popen(command) do |stdout|
output = stdout.read
STDOUT.print output if verbose
result << output
end
whee!
osascript -e 'path to application "terminal-notifier"'
0:39: execution error: terminal-notifier got an error: Connection is invalid. (-609)
Wouldn't it be conceivable to listen notifications from network ?
Maybe it could be another project such as terminal-notifier-daemon, but in order to completely remove Growl that would be great if terminal-notifier could handle external notifications such as system alerts or build statuses, etc...
I can imagine it's not trivial, security is important, finding the good port is crucial, dealing with floods, etc...
But hey, let's say it's a feature request ;)
Currently (1.4.2), if you send a notification while another one (also sent by terminal-notifier) is still showing, the latter replaces the former.
This behavior seems to be independent of whether different group IDs are used or not.
It would be nice to have the option to have multiple notifications show simultaneously (issued in short sequence), as in Growl.
Thanks for a great tool, btw.
Platform: Ruby 1.9.3-p194, Mountain Lion
In "lib/terminal-notifier.rb", if you add this line after the "module TerminalNotifier" line, the warning goes away:
@available = nil
Am I expecting something that shouldn't happen? Intuitively, it seems that when I click on the notification in the notification center, the notification should be removed, however that is not the case.
What kind of debugging information can I give you to help this get resolved?
I've installed this under OS X 10.9 Developer Preview 7.
When I attempt to send notifications nothing seems to appear.
I've checked in console and cannot see any errors.
Please let me know where I might be able to see debug information to improve reporting of this issue.
Hi,
your tool is amazing and the progress is stunning! You already replaced growlnotify for me and with the -activate key, I have build some nice recursive messages ;-)
Now to the question:
is it technically possible to check or probe, if a notification of a given group is currently displayed?
The -remove switch can remove a group. If posting multiple messages to one group, the old one gets discarded and some info is printed ("...which was delivered on: 2012-07-31 18:12:59 +0000").
Is a "-check" option possible that just outputs something like " Yep, message of that group is currently being displayed. Since 2012-07-31 18:12:59)." That would come in really handy for some scripts that only post messages to a group if the old message is older than x minutes. Or I could -remove messages that are older than y minutes.
Keep up the great work!
terminal-notifier -title "#channel" -subtitle "<+username>" -message "my message"
will show as:
my message
on the command line if i escape the < it works... but over an ssh not working.
Anyway to use <> in the fields and not break?
Hi, just emailed eloy this morning, in order to ask him if terminal-notifier would have the new Mavericks options in a notification as close, view, delete, etc...
well, he told me to post in github, so excuse me if it is not the right place for it, i don't really know how to use it correctly.
thanks.
milestone: 1k downloads
I'm wondering if it is somehow possible to color the title or message?
Since we don't get a custom icon easily this could be an option for guard users to color passing and failing tests.
$ brew install terminal-notifier
==> Downloading https://github.com/alloy/terminal-notifier/archive/v1.5.1.tar.gz
==> xcodebuild -project Terminal Notifier.xcodeproj -target terminal-notifier SYMROOT=bui
/usr/local/Cellar/terminal-notifier/1.5.1: 11 files, 484K, built in 4 seconds
YAY
@alloy I am wondering if I can pass an ico option so that it display it instead of the terminal icon. I'll be glad to make it happen if you point me in the right direction.
Doing -sender by itself works, and doing -execute by itself works, but when doing both, -execute doesn't seem to be done.
terminal-notifier -message "test" -sender "com.apple.iTunes"
terminal-notifier -message "test" -execute "say Test"
terminal-notifier -message "test" -sender "com.apple.iTunes" -execute "say Test"
Installed from gem, on Mac OSX 10.7.5. No matter if I try to run it via the wrapper or directly inside *.app (like described in readme), result is like this:
$ terminal-notifier -message "foo"
Segmentation fault: 11
I'd like to periodically pop up a notification (I have a "current task" I'd like to display, in a Pomodoro style app). I am attempting to use a user Launch Agent to schedule the task, which works successfully for running .sh
or .py
scripts. However, I'm not able to schedule the terminal-notifier
to successfully launch. A possible cause from other reading is that the Environment variables are different for the Launch Agent process than the usual logged in user's Environment.
Please see this StackOverflow question for the details:
http://stackoverflow.com/questions/16616441/failure-to-run-terminal-notifier-ruby-app-from-a-launch-agent-in-osx-environm
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.