node-tray

1.0.6 • Public • Published

npm version License: MIT

node-tray

Another library for rendering a tray icon on Windows.

Usage

See example.

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

How to dev/build

Windows

Should just work out of the box.

Linux

Build success was tested but I can't evaluate whether it actually works. Please let me know if you can!

Installing dependencies will probably fail, because compilation is part of that.

On Debian based systems:

  1. sudo apt-get install libgtk-3-dev xorg-dev libappindicator3-dev
  2. Run install again or pnpm dev.
  3. If it still fails, you might have to update PKG_CONFIG_PATH in node-gyp depending on whether your distro installs the libraries somewhere else. (And possibly the precise version of appindicator.)

Mac

I'm unable to verify either building or running this on Mac. Please let me know if you can!

Dev notes

  • Ideally use this cross platform tray implementation instead of the current one (which originally also supports multiple platforms but is out of date anyway). I've not been able to compile it on my Windows machine. It's not feasible to use this because it can't be compiled using just node-gyp. So the only thing that could be done would be to re-enable support for Linux using the original tray library.

Package Sidebar

Install

npm i node-tray

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

99.8 kB

Total Files

8

Last publish

Collaborators

  • s-h-a-d-o-w