From 07f3c89480e291b83b0fc53fa33874dc1e77fae9 Mon Sep 17 00:00:00 2001 From: Tobias Ganter Date: Sat, 29 Aug 2026 19:27:02 +0200 Subject: [PATCH] fix: search ~/.steam/root and Flatpak data/Steam roots Layouts from PR #1 (Manjaro report), folded into tools/steam_paths.py. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014TkQMhvEyoFqKzeCC69N6o --- tests/test_steam_paths.py | 36 ++++++++++++++++++++++++++++++++++++ tools/steam_paths.py | 2 ++ 2 files changed, 38 insertions(+) diff --git a/tests/test_steam_paths.py b/tests/test_steam_paths.py index 992fc8e..c75d09b 100644 --- a/tests/test_steam_paths.py +++ b/tests/test_steam_paths.py @@ -93,6 +93,42 @@ def test_steam_root_without_vdf_still_works(): ) +def test_legacy_steam_root_symlink(): + with tempfile.TemporaryDirectory() as home: + steam = os.path.join(home, ".steam/root") + make_library(steam) + env = {"HOME": home} + check( + steam_paths.find_data_dir(env) == os.path.join(steam, "steamapps/common/Cosmoteer/Data"), + "~/.steam/root was not searched", + ) + + +def test_flatpak_data_dir_layout(): + with tempfile.TemporaryDirectory() as home: + steam = os.path.join(home, ".var/app/com.valvesoftware.Steam/data/Steam") + make_library(steam) + env = {"HOME": home} + check( + steam_paths.find_mods_dir(env) == os.path.join(steam, PROTON_MODS), + "Flatpak XDG_DATA_HOME layout (.var/app/.../data/Steam) was not searched", + ) + + +def test_library_path_with_spaces(): + with tempfile.TemporaryDirectory() as home: + steam = os.path.join(home, ".local/share/Steam") + second = os.path.join(home, "my games/Steam Library") + make_library(steam, with_game=False, with_mods=False) + make_library(second) + write_vdf(steam, [steam, second]) + env = {"HOME": home} + check( + steam_paths.find_mods_dir(env) == os.path.join(second, PROTON_MODS), + "Library path containing spaces was not handled", + ) + + def test_windows_profile_mods_dir(): with tempfile.TemporaryDirectory() as profile: mods = os.path.join(profile, "Saved Games/Cosmoteer/76561190000000000/Mods") diff --git a/tools/steam_paths.py b/tools/steam_paths.py index 965e6d6..235c1ae 100755 --- a/tools/steam_paths.py +++ b/tools/steam_paths.py @@ -27,8 +27,10 @@ PROTON_PROFILE = "compatdata/" + APP_ID + "/pfx/drive_c/users/steamuser/Saved Ga STEAM_ROOTS_UNDER_HOME = [ ".local/share/Steam", ".steam/steam", + ".steam/root", ".steam/debian-installation", ".var/app/com.valvesoftware.Steam/.local/share/Steam", + ".var/app/com.valvesoftware.Steam/data/Steam", ".snap/steam/common/.local/share/Steam", "snap/steam/common/.local/share/Steam", ]