In most cases, the users of your application may only use it when required and then minimize or close the app.
You can significantly improve user experience by keeping the application up and running in the background and displaying it in the system tray area. Another essential feature is to have a global keyboard shortcut so that the users of your application can quickly invoke it without needing to use the mouse.
Let's start by integrating the system tray:
- First, you need to import the Menu and Tray objects from the Electron framework, the Tray integration, and also the path from Node.js to resolve the path to the Tray icon image:
const { Menu, Tray } = require('electron');
const path = require('path');
let tray;
- Next, create a folder called assets and put a small 16 x 16 image in png format inside...