julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.38k stars 330 forks source link

Small terminal icon in title when using -appIcon option #131

Closed stopiccot closed 9 years ago

stopiccot commented 9 years ago

https://www.dropbox.com/s/v3syj6a0t3631f9/Screenshot%202015-05-04%2018.32.58.png?dl=0

Not sure if it's a bug or an OS X intended behaviour

julienXX commented 9 years ago

It's the intended behavior.

arkarkark commented 9 years ago

Is there a way to suppress or change that little icon? It only seems to show up if I pass in -appIcon

danielbayley commented 9 years ago

@julienXX Can it be suppressed?

julienXX commented 9 years ago

Unfortunately I didn't found a way to suppress it so far. You still can make yourself a custom build with a transparent icon I guess.

julienXX commented 9 years ago

Also if you make a custom build with a new icon, you have to run: sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; to clear the cache.

Max-108 commented 8 years ago

I've replaced both Terminal.icns with transparent icon versions in both /Library/Ruby/Gems/2.0.0/gems/terminal-notifier-1.6.3/vendor/terminal-notifier/ and /Library/Ruby/Gems/2.0.0/gems/terminal-notifier-1.6.3/vendor/terminal-notifier/terminal-notifier.app/Contents/Resources/.

I even changed the app icon via the Finder info-window to a pasted blank one. I then ran the command above that correctly clears the Dock's icon cache and restarted, but yet the pesky little Terminal-Icon remains in the Title field - What have I missed?

julienXX commented 8 years ago

@Max-108 you have to download the source code update and re-compile it with your new icon.

vitorgalvao commented 8 years ago

Hope @julienXX doesn’t mind me referencing it (since I’m the author), but I’ve been using a custom-built script for this for quite a long time, with much success.

You simply run it with customise-terminal-notifier --icon <file> --bundle <bundle_id> and it’ll download the latest version of terminal-notifer to your Desktop and set your custom icon. You can then take that binary and use it as usual, without the need to set -appIcon and without having to recompile. To install the script, simply download it or do brew install vitorgalvao/tiny-scripts/customise-terminal-notifier (if you use Homebrew).

Keep in mind, though, the icon will be set permanently on that specific binary, but if you’re changing it to embed terminal-notifer in other apps, it’s often enough. If you’re distributing it, though, don’t forget to include terminal-notifier’s license. Also, in that case there may be (sometimes it happens, others it doesn’t) a one-time warning about the binary having been changed (only the icon is changed).

julienXX commented 8 years ago

Thanks @vitorgalvao! Do you mind if I reference your script in the README?

vitorgalvao commented 8 years ago

Do you mind if I reference your script in the README?

Don’t mind at all. Go for it.

Max-108 commented 8 years ago

Thank you for the PnP solution @vitorgalvao. (I'm new, so if thanks are considered extraneous here, sorry, and feel free to delete)

julienXX commented 8 years ago

@Max-108 thanks are always welcomed :)

reubano commented 8 years ago

FYI, I figured out a way without recompiling

julienXX commented 8 years ago

@reubano Excellent, thanks!

mikemcduffie commented 8 years ago

julienXX,

Would it be possible to add a default notification when the binary is executed via vitorgalvao's customise-terminal-notifier? The issue is the notification generated when a user double-clicks/opens the customized app. A blank notification titled "Terminal" is generated.

vitorgalvao commented 8 years ago

For a bit more context on @mikemcduffie’s comment, see https://github.com/vitorgalvao/tiny-scripts/issues/24.

To be clear, @mikemcduffie, customise-terminal-notifier has nothing to do with it. If you download an unmodified terminal-notifier it’ll behave exactly as you describe.

Issue is you’re not just supposed to open terminal-notifier while telling it nothing. You’re expected to give it the parameters you want it to run with.

mikemcduffie commented 8 years ago

@vitorgalvao,

Yes, I understand that. The issue I'm trying to work around is an uninformed user opening the helper app and being confused. I know it's the regular behavior of the CLI binary.

I moved the discussion here since it would require terminal-notifier to change to improve the bundled version.

mikemcduffie commented 8 years ago

I think I see why @vitorgalvao and I are talking past each other. I had forgotten that terminal-notifier is an app bundle in it's standard deployment. It's been so long since I installed it that I misremembered and thought it was a CLI binary only and customise-terminal-notifier was unique in bundling it. My bad.

Homebrew buries the app bundle so deep, it's not an issue for uninformed users. I had wanted to distribute the customized app with an Automator service in order to get a unique icon with the -open option. That and making it easier for novice users to install via drag and drop.

I still believe that user notification on app bundle launch is still desirable given the customized versions and request @julienXX consider it as an enhancement.

Any way, thanks again to both of you for your efforts.

vitorgalvao commented 8 years ago

@mikemcduffie I see your point. Perhaps the default message could be a note to the user they shouldn’t be double-clicking on it, since it should be required by other apps.

laxmikanta415 commented 6 years ago

This solved my problem :

run this command in terminal after downloading :customise-terminal-notifier

** path/customise-terminal-notifier-master/customise-terminal-notifier -i path/Terminal.icns -b com.bundle.identifier

jlippold commented 1 month ago

https://github.com/vitorgalvao/tiny-scripts/blob/master/customise-terminal-notifier is 404 and the tap is dead. @vitorgalvao is this source code available still?

vitorgalvao commented 1 month ago

@jlippold It is still available, through the power of git. Note that specifically gets terminal-notifier 1.7.2 because later versions made the technique incompatible.

You’re weIcome to modify and use that as you see fit. I no longer offer support for it (but it should still work) since I have changed to my own custom solution many years ago and am no longer familiar with the inner workings of terminal-notifier. I have since also narrowed down my solution to work specifically with Alfred workflows, since that’s what I (and the users of my tool) always used it for anyway, so that wouldn’t be a drop-in replacement for you if you need a generic use case. It could be readapted for it (the change was made about two years ago) but I don’t offer support for that either.

Hope that clarified everything. Have a nice Sunday.

jlippold commented 1 month ago

It's too bad your new notificator script can't be called from terminal without Alfred. Anyways, I'll try to compile your legacy script. Thanks!

jlippold commented 1 month ago

The resulting app that your script makes probably needs to be signed. This is too much work for an app icon :P

image

vitorgalvao commented 1 month ago

It's too bad your new notificator script can't be called from terminal without Alfred.

It can. But you have to preset the variables and the icon in the right structure beforehand. A major point of the changes is not having to do so manually or needing to build the app beforehand. It’s a much nicer experience: run the script and get the notification.

The resulting app that your script makes probably needs to be signed.

Because you’re using the old unsupported version. The new one doesn’t have that issue as it builds the notification app on demand. But as I said, I don’t offer support for alternate uses of that script now.