Dashboard patches: persist frame-controls placements and "Steam hidden" on disk

SteamOS's steamvr.service runs `rm -rf ~/.cache/SteamVR` on every SteamVR
start, which deletes vrwebhelper's browser profile and with it the
localStorage frame-controls kept its placements in, so they were lost on
every SteamVR restart and reboot.

steam-ui-patches: per-patch persistent state (`state = true`). The injector
keeps ~/.local/state/steam-frame-nix/ui-patches/<name>.json, seeds
window.__sfuiStore in a fresh page before the patch runs and writes the file
(atomically, on change, name-checked, max 64 KiB) when the page calls the
CDP binding __sfuiStoreSave.

frame-controls v5: placements saved there (v4 localStorage copy migrated
once, then removed). steam-close-button v8: "Steam hidden" saved there; a
restored hidden state hides Steam once if SteamVR already shows it when the
patch attaches (or first shows it before the patch sees Steam's frame).

README: "Changes outside Nix" lists the directory; install.sh uninstall
removes it.
This commit is contained in:
Pierre Kisters committed 2026-09-28 23:33:12 +02:00
1 parent 48d10cc483
commit 7fe68e055c
10 files changed
+215 -34

No files matched your search

+4 -1
View File
@@ -11,7 +11,9 @@ in {
options.steamFrame.dashboard.steamCloseButton.enable = lib.mkEnableOption ''
a Close (X) button on the dashboard's Steam window. It hides Steam
(previous window or just the bar) until shown explicitly, e.g. via the
Steam tab. SteamVR dashboard patch; off removes it (next switch)'';
Steam tab, also across SteamVR restarts and reboots (in
~/.local/state/steam-frame-nix/ui-patches/steam-close-button.json).
SteamVR dashboard patch; off removes it (next switch)'';
config = lib.mkIf cfg.enable {
steamFrame.uiPatches.patches = [ {
@@ -23,6 +25,7 @@ in {
src = ./steam-close-button/patch.js;
};
unpatch = ./steam-close-button/unpatch.js;
state = true; # "Steam hidden", kept across restarts
} ];
};
}