Various scripts that I maintain

Add steam-disable-update script

+45 -1
+13 -1
README.md
··· 57 57 58 58 Update symlink targets from an old target directory to a new one 59 59 60 - Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all 60 + Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all 61 61 symlinks in `~/.local/bin` that point to the old location with 62 62 `relink ~/.local/bin ~/Development/tools ~/Applications` 63 + 64 + # Steam: Disable Update 65 + 66 + Completely disable steam updates for a game or app. 67 + 68 + Usage: `steam-disable-update <appid>` 69 + Allow updates: `steam-disable-update --revert <appid>` 70 + 71 + Caveats to this approach: 72 + - Your "last played" time will never update 73 + - I haven't used it in a long time, so I can't guarantee it will work 74 + - It might cause other bugs, I haven't tested it extensively
+32
scripts/steam-disable-update.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 + 5 + use std log 6 + 7 + # Common app IDs 8 + # Beat Saber: 620980 9 + # SteamVR: 250820 10 + def main [ 11 + appid: int 12 + --revert (-r) # Allow updates again 13 + ] { 14 + let manifest = $"~/.steam/root/steamapps/appmanifest_($appid).acf" | path expand 15 + 16 + if $revert { 17 + log info "Making file mutable." 18 + pkexec chattr -i $manifest 19 + return 20 + } 21 + 22 + open $manifest 23 + | str replace -r "\"StateFlags\"\t\t.*" "\"StateFlags\"\t\t\"4\"" 24 + | str replace -r "\"UpdateResult\"\t\t.*" "\"UpdateResult\"\t\t\"0\"" 25 + | str replace -r "\"AutoUpdateBehavior\"\t\t.*" "\"AutoUpdateBehavior\"\t\t\"1\"" 26 + | str replace -r "\"ScheduledAutoUpdate\"\t\t.*" "\"ScheduledAutoUpdate\"\t\t\"0\"" 27 + | collect 28 + | save -f $manifest 29 + 30 + log info "Making file immutable, use `steam-disable-update --revert <appid>` to revert." 31 + pkexec chattr +i $manifest 32 + }