Skip to content

Settings: Save Battery row needs the shared console UI #31

Open

Description

@broslife

What

A Save Battery switch in the console's Settings, on the Switch only. The title already reads and acts on it (branch clock-control, PR #15). The row itself has to come from the shared console UI in the monorepo, because the settings rows are a fixed table there (crates/client/pf-console-ui/src/screens/settings/rows.rs).

How the title uses it

  • By default the title holds its own clocks: CPU 1428, GPU 422.4 (handheld) and memory 1600 MHz in the menu; CPU 1785 and memory 1600 in the stream.
  • With Save Battery on, it holds nothing and leaves the clocks to the system (CPU 1020 in handheld). It lets go of a sys-clk or Horizon OC override, or puts the stock rates back when no module is running.
  • The value is Settings::extra["nx.save_battery"], a bool. A missing key means off. The menu reads it every frame, so flipping the row takes effect at once.

What the monorepo needs

In pf-console-ui/src/screens/settings/rows.rs, following an existing Extra::Bool row such as PhoneRumble or BackgroundKeepAlive:

  1. A new RowId::SaveBattery.
  2. A key "nx.save_battery", for example in a switch_keys module next to device_keys.
  3. In RowId::extra: RowId::SaveBattery => Extra::Bool(SAVE_BATTERY_KEY, false).
  4. In row_on: RowId::SaveBattery => &[Switch].
  5. A place in a section. It belongs with the device rows rather than the host ones; not an advanced row.
  6. A label, a hint and an icon, with strings in pf-l10n. Suggested text:
    • Label: "Save Battery"
    • Hint: "Leaves the CPU, GPU and memory clocks to the system. Streams use a little less power and may show a little more latency."

What this repo does after that

Bump the monorepo rev in Cargo.toml (one value shared by every monorepo crate) to the commit that adds the row. That is the only change needed here: the next build after the bump shows the row, and the title already obeys it.

Testing before the row exists

Edit settings.json in the title's folder on the SD card and add "nx.save_battery": true inside "extra".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions