Millennium

repository·main·Indexed 26 days ago

https://github.com/steamclienthomebrew/millennium

An open-source modding framework for creating and managing Steam Client themes and plugins on Windows, Linux, and macOS. It features custom CSS editing, plugin support, and privacy tools. The ecosystem includes the Millennium SDK for developing React-based UI components and starlight (v1.1.1), a dedicated compiler tool for building plugins.

Tokens
15.2K
Snippets
25
Records
106
Agent score
83%

What's inside Millennium

  1. Use the Millennium SDK to develop plugins

    main

    The Millennium SDK is a library used to develop plugins for Millennium. It is an optimistic fork of the decky-frontend-lib used by Decky Loader.

    Developers use this library to provide custom React components that are based on the existing React UI components found in the Steam Client. This approach allows you to add UI elements and logic to the Steam Client without clobbering the existing UI. While primarily designed for adding new elements, it can also be used to extend existing Steam Client UI elements.

  2. Understand Millennium bootstrapping shims

    main

    Millennium uses platform-specific shims to bootstrap itself into Steam. These sub-folders are separate projects from the main Millennium binary and do not compile into the same executable. Depending on your operating system, Millennium relies on the following shims:

    • Windows: Uses wsock32.dll.
    • Linux: Uses a libXtst.so.6 proxy hook.
    • macOS (Install, default): Uses a Steam Millennium.app wrapper and a runtime payload installed via scripts/install_macos.sh.
    • macOS (Legacy install): Uses a libtier0_s.dylib reexport proxy installed via scripts/install_macos.sh --tier0-legacy.
    • macOS (Debug): Uses a steam_osx wrapper, a bootstrap dylib preload, execve reinjection into the Steam main process, and a child hook that loads hhx64 in Steam Helper.
  3. Add a new locale to Millennium

    main

    You can add new languages to Millennium, provided they are officially supported by Steam (refer to the "Full Platform Supported Languages" section in the Steamworks documentation).

    To add a locale:

    1. Base your new locale on the existing english.json file found in ./src/locales/.
    2. Name your file lang.json, where lang is the API language code from the Steam supported language list.
    3. Place the file in the ./src/locales/ directory.
    4. Append the new target file to the localizationFiles array in ./src/typescript/frontend/utils/localization-manager.ts.
  4. Configure BrowserView creation options

    main

    When calling Create or CreatePopup, you can pass a BrowserViewCreateOptions object to customize the view behavior:

    KeyTypeDescription
    bOnlyAllowTrustedPopupsboolean(Optional) Restrict to trusted popups.
    parentPopupBrowserIDnumber(Optional) The ID of the parent popup browser.
    strInitialURLstring(Optional) The initial URL to load.
    strUserAgentIdentifierstring(Optional) The user agent identifier.
    strUserAgentOverridestring(Optional) Override the user agent string.
    strVROverlayKeystring(Optional) VR overlay key.
  5. Manage application settings and configuration

    main

    Use the Apps interface to modify various Steam client settings for specific applications:

    • Launch Options: SetAppLaunchOptions(appId, launchOptions) and GetLaunchOptionsForApp(appId).
    • Language: SetAppCurrentLanguage(appId, language) (e.g., "english", "schinese").
    • Resolution: SetAppResolutionOverride(appId, resolution) and GetResolutionOverrideForApp(appId).
    • Updates & Downloads: SetAppAutoUpdateBehavior(appId, mode) and SetAppBackgroundDownloadsBehavior(appId, mode).
    • Library Assets: SetCustomArtworkForApp(appId, base64, imageType, assetType) and ClearCustomArtworkForApp(appId, assetType).
    • Controller Settings: SetControllerRumblePreference(appId, value) and ShowControllerConfigurator(appId).
    • Steam Cloud: ToggleAppSteamCloudEnabled(appId).
    • Steam Overlay: ToggleEnableSteamOverlayForApp(appId).
  6. Use BrowserManagerHook to manage browser visibility

    main

    The BrowserManagerHook class is a utility designed to manage the visibility of the main Steam browser window when the Millennium sidebar is open. It prevents the browser window from overlapping the sidebar by hiding the actual browser and replacing it with a captured snapshot (background image) of the browser state. This ensures a seamless visual experience without the browser window physically covering the sidebar UI.

    Key capabilities:

    • Hooking: Patches SetBounds and SetVisible on the MainWindowBrowserManager.m_browser object.
    • Snapshotting: Uses ChromeDevToolsProtocol to capture a JPEG screenshot of the browser target.
    • Visual Fallback: When the browser is hidden, it applies the snapshot as a background to an input blocker element to prevent flickering and maintain visual continuity.
  7. Initialize and clean up BrowserManagerHook

    main

    To use the BrowserManagerHook, you must first call hook() to patch the Steam browser methods. You can optionally pass skipCheckHealth: true to bypass the internal health check that monitors if patches are being overwritten by Steam's re-instantiation of browser objects.

    Always call unhook() when the feature is no longer needed to restore original Steam behavior and prevent memory leaks or unexpected side effects.