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.
This commit is contained in:
RJ Trujillo 2023-11-20 19:10:09 -07:00 committed by GitHub
parent 71310055ee
commit b35b1f2ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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"