···57575858Update symlink targets from an old target directory to a new one
59596060-Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all
6060+Example: If you moved all files in `~/Development/tools` to `~/Applications`, you can update all
6161symlinks in `~/.local/bin` that point to the old location with
6262`relink ~/.local/bin ~/Development/tools ~/Applications`
6363+6464+# Steam: Disable Update
6565+6666+Completely disable steam updates for a game or app.
6767+6868+Usage: `steam-disable-update <appid>`
6969+Allow updates: `steam-disable-update --revert <appid>`
7070+7171+Caveats to this approach:
7272+- Your "last played" time will never update
7373+- I haven't used it in a long time, so I can't guarantee it will work
7474+- It might cause other bugs, I haven't tested it extensively
+32
scripts/steam-disable-update.nu
···11+#!/usr/bin/env nu
22+# SPDX-License-Identifier: AGPL-3.0-only
33+# Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com>
44+55+use std log
66+77+# Common app IDs
88+# Beat Saber: 620980
99+# SteamVR: 250820
1010+def main [
1111+ appid: int
1212+ --revert (-r) # Allow updates again
1313+] {
1414+ let manifest = $"~/.steam/root/steamapps/appmanifest_($appid).acf" | path expand
1515+1616+ if $revert {
1717+ log info "Making file mutable."
1818+ pkexec chattr -i $manifest
1919+ return
2020+ }
2121+2222+ open $manifest
2323+ | str replace -r "\"StateFlags\"\t\t.*" "\"StateFlags\"\t\t\"4\""
2424+ | str replace -r "\"UpdateResult\"\t\t.*" "\"UpdateResult\"\t\t\"0\""
2525+ | str replace -r "\"AutoUpdateBehavior\"\t\t.*" "\"AutoUpdateBehavior\"\t\t\"1\""
2626+ | str replace -r "\"ScheduledAutoUpdate\"\t\t.*" "\"ScheduledAutoUpdate\"\t\t\"0\""
2727+ | collect
2828+ | save -f $manifest
2929+3030+ log info "Making file immutable, use `steam-disable-update --revert <appid>` to revert."
3131+ pkexec chattr +i $manifest
3232+}