function isWaylandSession() {
  if (process.platform !== 'linux') return false;

  return (
    process.env['WAYLAND_DISPLAY'] !== undefined
    || process.env['XDG_SESSION_TYPE'] !== 'x11'
  );
}
Checks whether the current system session uses the Wayland
windowing system