Skip to content

Instantly share code, notes, and snippets.

@g0r3
Created September 4, 2026 10:16
Show Gist options
  • Select an option

  • Save g0r3/1fd26e6ada466a82211d4c58b3a9ad0c to your computer and use it in GitHub Desktop.

Select an option

Save g0r3/1fd26e6ada466a82211d4c58b3a9ad0c to your computer and use it in GitHub Desktop.
Electron 43: Tray icon never registers with StatusNotifierWatcher (minimal repro)
// Minimal reproduction for: Tray icon never appears on Linux under Electron 43.
//
// Run on a StatusNotifier desktop (e.g. KDE Plasma) and watch the registration:
// dbus-monitor --session "interface='org.kde.StatusNotifierWatcher'"
//
// Electron 41 / 42 pass the unique connection name -> ":1.173"
// Electron 43 passes bus name + object path joined -> "org.freedesktop.StatusNotifierItem-<pid>-1/StatusNotifierItem/1"
//
// The joined form is neither accepted argument, so the registration is dropped
// and no icon appears.
const { app, Tray, nativeImage } = require('electron')
// 16x16 solid PNG, inlined so this repro is two text files.
const ICON =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGUExURf8AAP///0EdNBEAAAABYktHRAH/Ai3eAAAAB3RJTUUH6gkECgs22KCu5gAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNi0wOS0wNFQxMDoxMTo1NCswMDowMHvzktcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjYtMDktMDRUMTA6MTE6NTQrMDA6MDAKriprAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI2LTA5LTA0VDEwOjExOjU0KzAwOjAwXbsLtAAAAAxJREFUCNdjYCANAAAAMAABx6qFjgAAAABJRU5ErkJggg=='
app.whenReady().then(() => {
global.tray = new Tray(nativeImage.createFromDataURL(ICON))
global.tray.setToolTip('electron-tray-sni-repro')
console.log('tray created; electron', process.versions.electron)
setTimeout(() => app.quit(), 18000)
})
app.on('window-all-closed', () => {})
{
"name": "electron-tray-sni-repro",
"version": "1.0.0",
"main": "main.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment