From 23e5ec9fa4747ea05219b66ec938112c2a0fa110 Mon Sep 17 00:00:00 2001 From: "Josh.5" Date: Mon, 23 Jun 2025 06:03:31 +0000 Subject: [PATCH] Add some sane defaults to Steam config I can't imagine why we would not want compatibility on for all titles or why we would not want to have a good name and the correct path for the default library. --- overlay/etc/cont-init.d/90-configure_steam.sh | 81 +++++++++++++++++-- 1 file changed, 75 insertions(+), 6 deletions(-) diff --git a/overlay/etc/cont-init.d/90-configure_steam.sh b/overlay/etc/cont-init.d/90-configure_steam.sh index 5bef278..ecd3b8d 100644 --- a/overlay/etc/cont-init.d/90-configure_steam.sh +++ b/overlay/etc/cont-init.d/90-configure_steam.sh @@ -18,15 +18,40 @@ Hidden=false EOF )" +default_steam_config="$( + cat <"${CONFIG_VDF}" + chown -R "${USER:?}:${USER:?}" "${USER_HOME:?}/.steam" + else + print_step_header "Steam config already exists, skipping initialization" + 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" + if [ ! -f "${LIBRARY_VDF}" ]; then + print_step_header "Initializing Steam library" mkdir -p "$(dirname "${LIBRARY_VDF}")" echo "${default_steam_library_config}" >"${LIBRARY_VDF}" - chown "${USER:?}:${USER:?}" "${LIBRARY_VDF}" + chown -R "${USER:?}:${USER:?}" "${USER_HOME:?}/.steam" + # Only if we have mounted a /mnt/games path, then make the default games library for steam + if [ -d "/mnt/games" ]; then + mkdir -p "/mnt/games/GameLibrary/Steam/steamapps" + chown "${USER:?}:${USER:?}" \ + "/mnt/games/GameLibrary" \ + "/mnt/games/GameLibrary/Steam" \ + "/mnt/games/GameLibrary/Steam/steamapps" + echo "${games_steam_library_config}" >"/mnt/games/GameLibrary/Steam/libraryfolder.vdf" + fi + else + print_step_header "Steam library config already exists, skipping initialization" fi else print_step_header "Disable Steam service"