Skip to content

Commit

Permalink
fix: Use new env variables to detect GNOME
Browse files Browse the repository at this point in the history
The environment variable GNOME_SETUP_DISPLAY is not reliably set since
GNOME 45. By contrast, it seems that env variables XDG_CURRENT_DESKTOP
and XDG_SESSION_DESKTOP are reliably set from now on.
As a fallback, the user can deliberately set up the `GSCONNECT_MODE`
environment variable as `cli` to claim the cli mode.
Fix #1706
  • Loading branch information
JingMatrix authored and andyholmes committed Dec 7, 2023
1 parent 96e4103 commit 381a435
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/utils/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ for (const path of [Config.CACHEDIR, Config.CONFIGDIR, Config.RUNTIMEDIR])
*/
globalThis.HAVE_REMOTEINPUT = GLib.getenv('GDMSESSION') !== 'ubuntu-wayland';
globalThis.HAVE_WAYLAND = GLib.getenv('XDG_SESSION_TYPE') === 'wayland';
globalThis.HAVE_GNOME = GLib.getenv('GNOME_SETUP_DISPLAY') !== null;
globalThis.HAVE_GNOME = GLib.getenv('GSCONNECT_MODE')?.toLowerCase() !== 'cli' && (GLib.getenv('GNOME_SETUP_DISPLAY') !== null || GLib.getenv('XDG_CURRENT_DESKTOP')?.toUpperCase() === 'GNOME' || GLib.getenv('XDG_SESSION_DESKTOP')?.toLowerCase() === 'gnome');


/**
Expand Down

0 comments on commit 381a435

Please sign in to comment.