bazzite/spec_files/jupiter-hw-support/user.patch
2023-07-15 09:18:34 -06:00

43 lines
2.5 KiB
Diff

diff --git a/usr/lib/hwsupport/steamos-automount.sh b/usr/lib/hwsupport/steamos-automount.sh
index 023d95e..d69fd03 100755
--- a/usr/lib/hwsupport/steamos-automount.sh
+++ b/usr/lib/hwsupport/steamos-automount.sh
@@ -140,13 +140,14 @@ do_mount()
fi
# Ask udisks to auto-mount. This needs a version of udisks that supports the 'as-user' option.
+ USER=$(id -nu 1000)
ret=0
reply=$(busctl call --allow-interactive-authorization=false --expect-reply=true --json=short \
org.freedesktop.UDisks2 \
/org/freedesktop/UDisks2/block_devices/"${DEVBASE}" \
org.freedesktop.UDisks2.Filesystem \
Mount 'a{sv}' 4 \
- as-user s deck \
+ as-user s ${USER} \
auth.no_user_interaction b true \
fstype s "$FSTYPE" \
options s "$OPTS") || ret=$?
@@ -157,7 +158,7 @@ do_mount()
fi
# Expected reply is of the format
- # {"type":"s","data":["/run/media/deck/home"]}
+ # {"type":"s","data":["/run/media/${USER}/home"]}
mount_point=$(jq -r '.data[0] | select(type == "string")' <<< "$reply" || true)
if [[ -z $mount_point ]]; then
echo "Error when mounting ${DEVICE}: udisks returned success but could not parse reply:"
@@ -198,9 +199,9 @@ do_mount()
# bind mount compatdata folder from internal disk
mkdir -p "${mount_point}"/steamapps/compatdata
chown 1000:1000 "${mount_point}"/steamapps{,/compatdata}
- mkdir -p /home/deck/.local/share/Steam/steamapps/compatdata
- chown 1000:1000 /home/deck/.local{,/share{,/Steam{,/steamapps{,/compatdata}}}}
- mount --rbind /home/deck/.local/share/Steam/steamapps/compatdata "${mount_point}"/steamapps/compatdata
+ mkdir -p /home/${USER}/.local/share/Steam/steamapps/compatdata
+ chown 1000:1000 /home/${USER}/.local{,/share{,/Steam{,/steamapps{,/compatdata}}}}
+ mount --rbind /home/${USER}/.local/share/Steam/steamapps/compatdata "${mount_point}"/steamapps/compatdata
fi
# backwards compatibility