From b35b1f2ea09f85512dd65f472b57902548f6ef3a Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Mon, 20 Nov 2023 19:10:09 -0700 Subject: [PATCH] fix(autologin/return-to-gamemode): Don't assume path to home directory (#571) In cases where the home directory path differs from the user name, it isn't enough to use a hard path that assumes the user's username is in it. --- system_files/deck/shared/usr/bin/bazzite-autologin | 3 ++- system_files/deck/shared/usr/bin/return-to-gamemode | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/system_files/deck/shared/usr/bin/bazzite-autologin b/system_files/deck/shared/usr/bin/bazzite-autologin index 5932f905..3c7ac50b 100755 --- a/system_files/deck/shared/usr/bin/bazzite-autologin +++ b/system_files/deck/shared/usr/bin/bazzite-autologin @@ -6,6 +6,7 @@ IMAGE_INFO="/usr/share/ublue-os/image-info.json" BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO) USER=$(id -nu 1000) +HOME=$(getent passwd $USER | cut -d: -f6) # SteamOS SDDM config SDDM_CONF='/etc/sddm.conf.d/steamos.conf' @@ -18,7 +19,7 @@ if [[ -f ${AUTOLOGIN_CONF} ]]; then fi # Configure autologin if Steam has been updated -if [[ ! -f ${DESKTOP_AUTOLOGIN} && -f /var/home/$USER/.local/share/Steam/ubuntu12_32/steamui.so ]]; then +if [[ ! -f ${DESKTOP_AUTOLOGIN} && -f $HOME/.local/share/Steam/ubuntu12_32/steamui.so ]]; then sed -i 's/.*Session=.*/Session=gamescope-session.desktop/g' ${SDDM_CONF} elif [[ ${BASE_IMAGE_NAME} =~ "kinoite" ]]; then if ${DESKTOP_WAYLAND}; then diff --git a/system_files/deck/shared/usr/bin/return-to-gamemode b/system_files/deck/shared/usr/bin/return-to-gamemode index 55f5227b..97822e63 100755 --- a/system_files/deck/shared/usr/bin/return-to-gamemode +++ b/system_files/deck/shared/usr/bin/return-to-gamemode @@ -4,12 +4,13 @@ IMAGE_INFO="/usr/share/ublue-os/image-info.json" BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO) USER=$(id -nu 1000) +HOME=$(getent passwd $USER | cut -d: -f6) # SteamOS autologin SDDM config AUTOLOGIN_CONF='/etc/sddm.conf.d/zz-steamos-autologin.conf' # Configure autologin if Steam has been updated -if [[ -f /var/home/$USER/.local/share/Steam/ubuntu12_32/steamui.so ]]; then +if [[ -f $HOME/.local/share/Steam/ubuntu12_32/steamui.so ]]; then { echo "[Autologin]" echo "Session=gamescope-session.desktop"