In Electron, it is possible to create a tray icon by using new Tray(image), for example:
let iconPath = path.join(__dirname, 'icon.png');
appIcon = new Tray(iconPath);
As stated in the documentation:
..
Creates a new tray icon associated with the image.
..
Is it possible to replace the current Tray icon, instead of creating a new one?
This is possible by using the tray.setImage(image) function.
Example:
let iconPath = path.join(__dirname, 'icon.png');
appIcon.setImage(iconPath);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With