Closed jokeyrhyme closed 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
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
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:
Okay, I think we've got this down to just what is needed and nothing more :)
@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:
The only review that matters right now is QA
Thanks all <3
Fixed