julienXX / terminal-notifier

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

Change Terminal icon in title line? #237

Closed JayBrown closed 6 years ago

JayBrown commented 6 years ago

Is there a way to change the inline Terminal icon in the title line to an icon defined by the user, or even to no icon at all? Or is the Terminal icon hardcoded into the executable?

snap

Note: I don't mean the -contentImage option, but would be looking for something like -titleImage, which would change the icon left of the title string "Terminal" in the above example.

julienXX commented 6 years ago

Could you try the solution in #131 if it still works?

JayBrown commented 6 years ago

The trick making your own fake app, changing its icon, and using its BundleID for the -sender option still works. But when trying this out, I stumbled across a different solution. When you change the Terminal.icns file in terminal-notifier.app/Contents/Resources, while keeping the basename or changing the string in Info.plist, of course, and then use a non-existent BundleID, e.g. -sender com.apple.FakeApp, then terminal-notifier will show its own app icon, which will be your replacement icon. Example:

snap

JayBrown commented 6 years ago

Now I only need to see if it's possible to show no icon at all, maybe with a transparent 1px image as .icns file. (?)

JayBrown commented 6 years ago

It's possible using a transparent image, but it still leaves empty space. Doesn't look good.

snap

salihzett commented 6 years ago

@JayBrown I had the same idea but it doesnt work. version 2.0.0 any idea? do u have the same issue now?

JayBrown commented 6 years ago

I've reverted to changing the Terminal.icns file in the terminal-notifier.app bundle:

bundle-contents

This changes the app icon as shown by the system…

bundle

…and that's how it's also displayed in the first line of the terminal-notifier notification:

tn-notify

But that's something that every user can do for himself, or a developer, if he wants to bundle terminal-notifier with his own software, i.e. you wouldn't need to update terminal-notifier itself for it.

As for no icon at all, I don't think the user can implement this on his own somehow. It should be dealt with in a terminal-notifier update, if it's at all possible, which I currently doubt.

julienXX commented 6 years ago

Thanks for this! For the no-icon option, it seems not possible to provide as there is no API for it so far.