From ac99687940e3b6332a75a4bb3cfa235175bfd4a0 Mon Sep 17 00:00:00 2001 From: Shiloh Fen Date: Thu, 10 Jul 2025 20:11:08 -0500 Subject: [PATCH] Add steam-disable-update script --- README.md | 14 +++++++++++++- scripts/steam-disable-update.nu | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 scripts/steam-disable-update.nu diff --git a/README.md b/README.md index 75e4265..38aa9cc 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,18 @@ Uses lighthouse_console to reset all SteamVR dongles, then put them all into pai Update symlink targets from an old target directory to a new one -Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all +Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all symlinks in `~/.local/bin` that point to the old location with `relink ~/.local/bin ~/Development/tools ~/Applications` + +# Steam: Disable Update + +Completely disable steam updates for a game or app. + +Usage: `steam-disable-update ` +Allow updates: `steam-disable-update --revert ` + +Caveats to this approach: +- Your "last played" time will never update +- I haven't used it in a long time, so I can't guarantee it will work +- It might cause other bugs, I haven't tested it extensively diff --git a/scripts/steam-disable-update.nu b/scripts/steam-disable-update.nu new file mode 100644 index 0000000..931b931 --- /dev/null +++ b/scripts/steam-disable-update.nu @@ -0,0 +1,32 @@ +#!/usr/bin/env nu +# SPDX-License-Identifier: AGPL-3.0-only +# Copyright (c) 2025 Shiloh Fen + +use std log + +# Common app IDs +# Beat Saber: 620980 +# SteamVR: 250820 +def main [ + appid: int + --revert (-r) # Allow updates again +] { + let manifest = $"~/.steam/root/steamapps/appmanifest_($appid).acf" | path expand + + if $revert { + log info "Making file mutable." + pkexec chattr -i $manifest + return + } + + open $manifest + | str replace -r "\"StateFlags\"\t\t.*" "\"StateFlags\"\t\t\"4\"" + | str replace -r "\"UpdateResult\"\t\t.*" "\"UpdateResult\"\t\t\"0\"" + | str replace -r "\"AutoUpdateBehavior\"\t\t.*" "\"AutoUpdateBehavior\"\t\t\"1\"" + | str replace -r "\"ScheduledAutoUpdate\"\t\t.*" "\"ScheduledAutoUpdate\"\t\t\"0\"" + | collect + | save -f $manifest + + log info "Making file immutable, use `steam-disable-update --revert ` to revert." + pkexec chattr +i $manifest +} -- 2.51.2