mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-14 15:44:47 +02:00
GDM steam-set-session: don't exit at boot when nobody is logged in
This commit is contained in:
1 parent
039f2691d8
commit
12eb56220a
1 file changed
+3
-1
@@ -14,7 +14,9 @@ case "$DM_ID" in
|
|||||||
sddm) CONF_FILE="/etc/sddm.conf.d/zz-steamos-autologin.conf" ;;
|
sddm) CONF_FILE="/etc/sddm.conf.d/zz-steamos-autologin.conf" ;;
|
||||||
gdm)
|
gdm)
|
||||||
if [[ -n "${PKEXEC_UID:-}" ]]; then TARGET_USER="$(id -un "$PKEXEC_UID")"
|
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.
|
# 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" ]] || TARGET_USER="$(sed -n 's/^AutomaticLogin=//p' /etc/gdm/custom.conf 2>/dev/null)"
|
||||||
[[ -n "$TARGET_USER" ]] || exit 0
|
[[ -n "$TARGET_USER" ]] || exit 0
|
||||||
|
|||||||
Reference in new issue
Block a user