diff --git a/data/phosh-session.in b/data/phosh-session.in index 6c295ab80f86a7ba68b349c9f350900ae2f04a60..8bac2fc31c869a3af5488c8613715f822d3092d4 100755 --- a/data/phosh-session.in +++ b/data/phosh-session.in @@ -50,8 +50,18 @@ if [ -f "$HOME/.phoshdebug" ]; then . "$HOME/.phoshdebug" fi +SESSION_MANAGER= +# old gnome-session: Pass --builtin or --systemd +if gnome-session --help | grep -qs '\-\-builtin'; then + SESSION_MANAGER=@session_manager@ +# gnome-session >= 46 doesn't support builtin +elif [ "@session_manager@" = "--builtin" ]; then + echo "ERR: gnome-session only supports systemd, session cannot start" 1>&2 + exit 1 +fi + # Run gnome-session through a login shell so it picks # variables from /etc/profile.d (XDG_*) [ -n "$WLR_BACKENDS" ] || WLR_BACKENDS=drm,libinput export WLR_BACKENDS -exec "${COMPOSITOR}" -S -C "${PHOC_INI}" -E "bash -lc 'exec ${GNOME_SESSION} --disable-acceleration-check --session=phosh @session_manager@'" +exec "${COMPOSITOR}" -S -C "${PHOC_INI}" -E "bash -lc 'exec ${GNOME_SESSION} --disable-acceleration-check --session=phosh ${SESSION_MANAGER}'" diff --git a/meson_options.txt b/meson_options.txt index 2320bd75f08c317222079f2512a9f100f0a2f2de..940cf9b1c1d8ad4883147dfe1cecf432cd2588e8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,7 +15,7 @@ option('man', description : 'generate man pages (requires rst2man)') option('systemd', - type: 'boolean', value: false, + type: 'boolean', value: true, description: 'Whether to generate systemd user units') option('compositor',