From 12eb56220a56f7b5fc6c564a63a678453781ae78 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Wed, 14 Oct 2026 14:08:44 +0200 Subject: [PATCH] GDM steam-set-session: don't exit at boot when nobody is logged in --- patches/steamify-gdm-steam-set-session.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/steamify-gdm-steam-set-session.sh b/patches/steamify-gdm-steam-set-session.sh index 6d963ee..efc958e 100644 --- a/patches/steamify-gdm-steam-set-session.sh +++ b/patches/steamify-gdm-steam-set-session.sh @@ -14,7 +14,9 @@ case "$DM_ID" in sddm) CONF_FILE="/etc/sddm.conf.d/zz-steamos-autologin.conf" ;; gdm) if [[ -n "${PKEXEC_UID:-}" ]]; then TARGET_USER="$(id -un "$PKEXEC_UID")" - else TARGET_USER="${SUDO_USER:-$(logname 2>/dev/null)}"; fi + else TARGET_USER="${SUDO_USER:-}"; fi + # (|| true: logname fails without a login, and set -e would end the script before the fallback.) + [[ -n "$TARGET_USER" ]] || TARGET_USER="$(logname 2>/dev/null || true)" # At boot (steamify-boot-desktop.service) nobody is logged in: the autologin user. [[ -n "$TARGET_USER" ]] || TARGET_USER="$(sed -n 's/^AutomaticLogin=//p' /etc/gdm/custom.conf 2>/dev/null)" [[ -n "$TARGET_USER" ]] || exit 0