diff --git a/overlay/etc/cont-init.d/90-configure_steam.sh b/overlay/etc/cont-init.d/90-configure_steam.sh index 6a562ed..5bef278 100644 --- a/overlay/etc/cont-init.d/90-configure_steam.sh +++ b/overlay/etc/cont-init.d/90-configure_steam.sh @@ -1,7 +1,8 @@ print_header "Configure Steam" -steam_autostart_desktop="$(cat < "${USER_HOME:?}/.config/autostart/Steam.desktop" + echo "${steam_autostart_desktop:?}" >"${USER_HOME:?}/.config/autostart/Steam.desktop" sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/steam.ini fi + + # Ensure Steam library folder is set to /mnt/games if not already + LIBRARY_VDF="${USER_HOME:?}/.steam/steam/steamapps/libraryfolders.vdf" + if [ ! -f "${LIBRARY_VDF}" ] || ! grep -q '"0"' "${LIBRARY_VDF}"; then + print_step_header "Initializing Steam library folder" + mkdir -p "$(dirname "${LIBRARY_VDF}")" + echo "${default_steam_library_config}" >"${LIBRARY_VDF}" + chown "${USER:?}:${USER:?}" "${LIBRARY_VDF}" + fi else print_step_header "Disable Steam service" sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/steam.ini