Skip to content

Commit

Permalink
fix(autologin/return-to-gamemode): Don't assume path to home directory (
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
EyeCantCU authored Nov 21, 2023
1 parent 7131005 commit b35b1f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion system_files/deck/shared/usr/bin/bazzite-autologin
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion system_files/deck/shared/usr/bin/return-to-gamemode
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b35b1f2

Please sign in to comment.