Fix Steam patch detection and preserve desktop overrides

This commit is contained in:
Scott Jones committed 2026-09-22 20:21:53 -04:00
1 parent 7721248925
commit 947eeea0dd
4 files changed
+49 -7

No files matched your search

@@ -10,6 +10,9 @@ steam_root="$HOME/.local/share/Steam"
write_steam_desktop() {
local app_dir="$HOME/.local/share/applications"
# This is a user-owned override. Create it once without replacing existing
# customizations, including a symlink managed by the user.
[[ -e $app_dir/steam.desktop || -L $app_dir/steam.desktop ]] && return 0
mkdir -p "$app_dir"
cat >"$app_dir/steam.desktop" <<'EOF'
[Desktop Entry]
@@ -63,8 +66,8 @@ replacement = (
for path in sorted(steamui.glob("chunk~*.js")):
text = path.read_text(errors="replace")
if "m_bIsConnectedToANetwork=!0" in text and "RegisterForDeviceChanges" in text:
continue
# The exact original block no longer matches after replacement. A generic
# connected-state assignment elsewhere in the chunk is not a patch marker.
updated, count = pattern.subn(replacement, text, count=1)
if count != 1:
continue