Files
lhns--steam-frame-nix/modules/steam-close-button.nix
T
Pierre Kisters e98563bf08 modules: consistency pass over patches and option docs
- pinned-desktop (VERSION 3): drop the stop() of a predecessor global that
  never existed in this repo; log errors as "sfui <NAME>:" through one
  guard helper, like the grid patch.
- steamCloseButton.enable is a mkEnableOption like the other feature
  switches; enable descriptions no longer end in a stray newline.
- launcher-menu.nix header lists show-all and no longer claims the patches
  use no webpack module; hiddenApps mentions showAllApps.
- Patch comments: frame-controls ring timing matches the code (half of
  longPressMs, at most 1 s), window-curvature names frame-controls as what
  moves its control into the bar, steam-close-button no longer refers to an
  unpublished version.
2026-09-27 23:28:05 +02:00

42 lines
1.9 KiB
Nix

# Close (X) button on the SteamVR dashboard's main Steam window
# (steamFrame.dashboard.steamCloseButton.enable): it switches to the
# previously active dashboard window, or leaves just the dashboard bar when
# Steam was the last one. Runtime patch of SteamVR's dashboard page
# (vrwebhelper "systemui", DevTools 127.0.0.1:8087; see
# steam-close-button/patch.js for how it works), registered with
# steam-ui-patches.nix only when enabled; it turns on the SteamVR web helper
# debugger (steamvr-debugger.nix), which needs one SteamVR restart the first
# time. Depends on SteamVR UI internals, found by signature
# (lib/signatures.json, "steam-close-button"; scripts/check-signatures.mjs
# checks them offline).
{ config, lib, pkgs, ... }:
let
cfg = config.steamFrame.dashboard.steamCloseButton;
inherit (import ./lib { inherit pkgs; }) mkPatch;
in {
imports = [ ./steam-ui-patches.nix ./steamvr-debugger.nix ];
options.steamFrame.dashboard.steamCloseButton.enable = lib.mkEnableOption ''
a Close (X) button on the SteamVR dashboard's main Steam window. It
docks the window back into the dashboard if it was placed in the world,
then switches to the most recently active other dashboard window, or,
with none, leaves the dashboard open with just its bar ("bar only";
kept when the dashboard is closed and reopened, until a window is
activated, e.g. with the Steam tab). Runtime patch of the SteamVR
dashboard (steamFrame.uiPatches), applied immediately; turning it off
removes the button (next switch)'';
config = lib.mkIf cfg.enable {
steamFrame.uiPatches.patches = [ {
name = "steam-close-button";
endpoint = "http://127.0.0.1:8087";
target.title = "systemui";
patch = mkPatch {
name = "steam-close-button";
src = ./steam-close-button/patch.js;
};
unpatch = ./steam-close-button/unpatch.js;
} ];
};
}