mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
feat: manage several Steam libraries beside internal and the card (#1967)
* feat: manage several Steam libraries beside internal and the card * fix: serialize Steam library registry edits, refuse folders inside a Games root, refresh games after changes * fix: rename refreshes games, added x86-64 libraries join redist seeding and direct mapping
This commit is contained in:
1 parent
c5577478ca
commit
e30e722f8b
16 files changed
+358
-9
No files matched your search
@@ -12,6 +12,7 @@ import xml.etree.ElementTree as ET
|
||||
|
||||
|
||||
LIBRARY = Path("/mnt/droiddeck-sd")
|
||||
ADDED = Path("/mnt/droiddeck-lib")
|
||||
URI = "file:///mnt/droiddeck-sd"
|
||||
KDE_OWNER = "http://www.kde.org"
|
||||
MARK = "DroidDeckSteamLibrary"
|
||||
@@ -42,7 +43,7 @@ def steam_libraries(home, data):
|
||||
if not isinstance(path, str):
|
||||
continue
|
||||
path = Path(re.sub(r'\\(["\\])', r'\1', path))
|
||||
managed = path == LIBRARY or path.is_relative_to(home / "Games")
|
||||
managed = path == LIBRARY or path.is_relative_to(home / "Games") or path.is_relative_to(ADDED)
|
||||
if selected is not None and managed and path not in selected:
|
||||
continue
|
||||
if path == LIBRARY and selected is None and not os.environ.get("BL_LIBRARY_LABEL"):
|
||||
|
||||
@@ -190,10 +190,14 @@ present() { awk -F'\t' -v hive="$hive" '
|
||||
regs=()
|
||||
for reg in "$steam_root"/steamapps/common/Proton*/files/share/default_pfx*/system.reg \
|
||||
/mnt/droiddeck-sd/steamapps/common/Proton*/files/share/default_pfx*/system.reg \
|
||||
/mnt/droiddeck-lib/*/steamapps/common/Proton*/files/share/default_pfx*/system.reg \
|
||||
/mnt/droiddeck-lib/*/x86-64/steamapps/common/Proton*/files/share/default_pfx*/system.reg \
|
||||
/root/Games/*/steamapps/common/Proton*/files/share/default_pfx*/system.reg \
|
||||
"$steam_root"/compatibilitytools.d/*/files/share/default_pfx*/system.reg \
|
||||
"$steam_root"/steamapps/compatdata/*/pfx/system.reg \
|
||||
/mnt/droiddeck-sd/steamapps/compatdata/*/pfx/system.reg \
|
||||
/mnt/droiddeck-lib/*/steamapps/compatdata/*/pfx/system.reg \
|
||||
/mnt/droiddeck-lib/*/x86-64/steamapps/compatdata/*/pfx/system.reg \
|
||||
/root/Games/*/steamapps/compatdata/*/pfx/system.reg; do
|
||||
[ -f "$reg" ] && regs+=("$reg")
|
||||
done
|
||||
|
||||
@@ -1217,12 +1217,12 @@ case $mode in
|
||||
: > "$compat_restarted"
|
||||
compat_restarts=0
|
||||
compat_settled() {
|
||||
local app m flags r card=/mnt/droiddeck-sd
|
||||
[ "$steam_x64" = 1 ] && card=/mnt/droiddeck-sd/x86-64
|
||||
local app m flags r card=/mnt/droiddeck-sd added=(/mnt/droiddeck-lib/*)
|
||||
[ "$steam_x64" = 1 ] && { card=/mnt/droiddeck-sd/x86-64; added=(/mnt/droiddeck-lib/*/x86-64); }
|
||||
while read -r app; do
|
||||
[ -n "$app" ] || continue
|
||||
m=
|
||||
for r in "$steam_root" "$card"; do
|
||||
for r in "$steam_root" "$card" "${added[@]}"; do
|
||||
[ -f "$r/steamapps/appmanifest_$app.acf" ] && { m=$r/steamapps/appmanifest_$app.acf; break; }
|
||||
done
|
||||
[ -n "$m" ] || return 1
|
||||
@@ -1291,7 +1291,7 @@ case $mode in
|
||||
done
|
||||
fi
|
||||
if [ "$beat" -le 720 ] && [ "$((beat % 3))" -eq 0 ] && { [ -z "$library_job" ] || ! kill -0 "$library_job" 2>/dev/null; }; then
|
||||
libraries=("$steam_root/steamapps" /mnt/droiddeck/steamapps /mnt/droiddeck-sd/steamapps /root/Games/*/steamapps)
|
||||
libraries=("$steam_root/steamapps" /mnt/droiddeck/steamapps /mnt/droiddeck-sd/steamapps /mnt/droiddeck-lib/*/steamapps /mnt/droiddeck-lib/*/x86-64/steamapps /root/Games/*/steamapps)
|
||||
seed=; compat=
|
||||
seed_due && seed=1
|
||||
compat_due && compat=1
|
||||
|
||||
@@ -142,6 +142,7 @@ def relabel(steam_root, target, label):
|
||||
|
||||
|
||||
GAMES_DIR = "/root/Games/"
|
||||
ADDED_DIR = "/mnt/droiddeck-lib/"
|
||||
|
||||
|
||||
def wanted():
|
||||
@@ -182,7 +183,7 @@ def main():
|
||||
if managed:
|
||||
keep = {library for library, _ in libraries}
|
||||
for library in registered(steam_root):
|
||||
if library not in keep and (library == LIBRARIES[0][0] or library.startswith(GAMES_DIR)):
|
||||
if library not in keep and (library == LIBRARIES[0][0] or library.startswith((GAMES_DIR, ADDED_DIR))):
|
||||
forget(steam_root, library)
|
||||
|
||||
|
||||
|
||||
@@ -82,8 +82,12 @@ x64_map_direct() {
|
||||
[ "${1:-}" = --live ] && mode=live
|
||||
[ -f "$STEAM_X64/config/config.vdf" ] || return 0
|
||||
if [ "$mode" = write ] && pgrep -f 'steamrt64/steam( |$)' >/dev/null 2>&1; then return 0; fi
|
||||
local libraries="$STEAM_X64/steamapps:/mnt/droiddeck-sd/x86-64/steamapps:$X64_HOME/shared/arm64/steamapps" library
|
||||
for library in /mnt/droiddeck-lib/*/x86-64/steamapps; do
|
||||
[ -d "$library" ] && libraries="$libraries:$library"
|
||||
done
|
||||
python3 - "$mode" "$STEAM_X64/config/config.vdf" "$STEAM_X64/appcache/appinfo.vdf" "$X64_HOME/direct-auto.json" \
|
||||
"$X64_HOME/direct-sniper" "$STEAM_X64/steamapps:/mnt/droiddeck-sd/x86-64/steamapps:$X64_HOME/shared/arm64/steamapps" "$(x64_default_tool)" \
|
||||
"$X64_HOME/direct-sniper" "$libraries" "$(x64_default_tool)" \
|
||||
"$REAL_HOME/.bl-compat-pending" ${BL_X64_DIRECT_APPS:-550} \
|
||||
<<'PY' || { [ "$mode" = live ] || step "could not map titles to DroidDeck direct"; }
|
||||
# Steam does not swap an installed build when the tool changes: a title installed for Windows stays on Proton.
|
||||
|
||||
Reference in new issue
Block a user