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

Default icon moves into title when using custom icon #175

Closed
naheller opened this issue May 23, 2017 · 6 comments
Closed

Default icon moves into title when using custom icon #175

naheller opened this issue May 23, 2017 · 6 comments

Comments

@naheller
Copy link

naheller commented May 23, 2017

This issue occurs on MacOS

Here is the notification:
notification

And the code that builds it:
screen shot 2017-05-23 at 1 51 46 pm

How can I get rid of the little black box icon? Thanks!

@mikaelbr
Copy link
Owner

Hi. For the current version of node-notifier check out this text in the readme: https://github.com/mikaelbr/node-notifier#custom-icon-without-terminal-icon-on-macos

Note: This is subject (possibly) to change in the next major release due to changes in dependency https://github.com/julienXX/terminal-notifier.

@naheller
Copy link
Author

naheller commented May 23, 2017

Thanks. Looks like a 16 step process, according to the linked issue #71. Will future versions of node-notifier be able to address this?

@gbougakov
Copy link

Here's a quick guide how to do it. (If you don't have an ICNS file, here's a converter)

  1. Navigate to node_modules/node-notifier/vendor
  2. Rename your custom icon into Terminal.icns
  3. Right-click terminal-notifier file and click Show Package Contents
  4. Navigate to Contents/Resources
  5. Replace Terminal.icns file with your own
    ezgif-2-637e763ed9

Here you go! Hope this helps.

@naheller
Copy link
Author

@georgebgk Hey there, thanks for your reply! If I make the edits you specified, will they remain in place when other people install and use the app? Won't the package.json file just install a fresh copy of node-notifier upon npm install?

@kurisubrooks
Copy link
Collaborator

You'll have to distribute your node-notifier binary. Add it to a lib/ folder or something, then commit it. You can use that explicit binary like so:

const { NotificationCenter } = require('node-notifier');

const notification = new NotificationCenter({
    customPath: path.join(__dirname, 'lib', 'notifier.app', 'Contents', 'MacOS', 'terminal-notifier')
});

@gbougakov
Copy link

@naheller Yes, it will, but if you use electron packager, your existing node-notifier will be kept.
Also, check that out:
You can move the binary out of node_modules and specify path to it
var notifier = new NotificationCenter({ withFallback: false, customPath: void 0 // Replace with path });

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