setDesktopName
Sets the .desktop filename on Linux. This must match the base filename of the app's installed .desktop file. The .desktop suffix is optional.
The name (without the .desktop suffix) is the app's identity for Linux desktop integration. It should be a reverse-DNS style ID such as com.example.MyApp, following the desktop entry naming conventions. This value is used as:
the XDG application ID (
app_id) on Wayland andWM_CLASSon X11, used to match the app's icon and window grouping.the app ID that
xdg-desktop-portalreports to portal backends such as GlobalShortcuts.
Portals increasingly enforce this identity. If the name is not a valid reverse-DNS ID or does not match an installed .desktop file:
GNOME 50.0/50.1 (Ubuntu 26.04) rejects
globalShortcutbinds withorg.freedesktop.portal.Error.NotAllowed— with no error surfaced to the app (see #52218).xdg-desktop-portal1.21 and later refuses portal sessions for app IDs it cannot resolve to a.desktopfile.
If this value is not set and desktopName is not present in package.json, Electron falls back to a lowercased, hyphenated slug of the app's name (e.g. My App → my-app.desktop), which is unlikely to be a valid portal identity — packaged apps should always set it explicitly.
This API must be called before the ready event. The value can also be set using desktopName in package.json.