node-tray
v2.0.5
Published
Another library for rendering a tray icon.
Maintainers
Readme
node-tray
Another library for rendering a tray icon.
Requirements
Linux
- libgtk-3-dev
- xorg-dev
- libayatana-appindicator3-dev
Usage
See directory example.
Icon image should be 48x48 for best compatibility. Windows can do 32x32, Linux can't. It's possible that 48x48 doesn't look as pretty on Windows and that it needs 32x32 for best results - I don't remember and don't have time to test. (Also, .ico on Windows, .png on Linux. And at least Linux seems to need absolute paths.)
When using a display scale other than 100% on Windows, the tray icon will look a bit soft. This can be resolved by enabling "compatibility setting -> high DPI -> scaling behavior performed by: application" for whatever executable you end up running this with/in. (Or inject a DPI manifest somehow - please let me know if you manage to do that successfully! 😄)
Usage in a prebuilt app
If you want to use something like node:sea to publish your app, you have to ship the bindings library (and its dependencies) and tray.node alongside the .exe. You can check out this project of mine for reference.
Differences to other projects
ctrayseems decent - check whether it maybe fits your needs better! It doesn't seem to allow for updating tray items "in place" though. (And initially, it bothered me that it doesn't support MacOS. I can't test on MacOS but at least there's a theoretical implementation. Contributions welcome!)systrayrelies on a precompiled binary - problematic secure-wise: https://github.com/zaaack/node-systray/tree/master/traybintrayiconrelies on a precompiled binary - problematic secure-wise: https://github.com/131/trayicon/blob/80837912e07c453ad39deea70b1fc566aa98faf3/index.js#L16.
