pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
220 stars 42 forks source link

fix: systemd fallbacks for session scripts #147

Closed jokeyrhyme closed 1 year ago

jokeyrhyme commented 1 year ago

Fixed

jokeyrhyme commented 1 year ago

Okay, I've installed GNOME and confirmed that if [ "${XDG_CURRENT_DESKTOP:-}" = "GNOME" ] && command -v gnome-session-quit >/dev/null; then works as expected when in a GNOME session that is started by GDM, which I assume is the common case for GNOME sessions

I've updated the PR accordingly

mmstick commented 1 year ago
is_gnome() {
    dbus-send --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:ShellVersion
}

if is_gnome; then
jokeyrhyme commented 1 year ago

Huh, I have to add the --print-reply flag to get that to return with an exit code when GNOME is not running:

❯ dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:ShellVersion
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Shell was not provided by any .service files

On my Archlinux system, it looks like /usr/bin/dbus-send is provided by the dbus package, which is required by gtk2, gtk3, pipewire, and systemd, but doesn't seem directly required by any of the GNOME packages (not even gtk4, weirdly), but it seems safe to assume that most GNOME systems will have it

Although, not all non-GNOME systems will have it :shrug:

jokeyrhyme commented 1 year ago

Okay, I think we've got this down to just what is needed and nothing more :)

jokeyrhyme commented 1 year ago

@merelymyself I can see you've contributed to these scripts in the past, would you care to review this PR (completely understand if you'd rather not)? :smile:

mmstick commented 1 year ago

The only review that matters right now is QA

jokeyrhyme commented 1 year ago

Thanks all <3