Galaxy Shell / docs
Docs / Interface and features

System quick settings

openspec/specs/quick-settings/spec.md · Edit on GitHub ↗

On this page

System quick settings

Purpose

A protected web panel opened from the indicators in the right corner of the bar, with audio, brightness, network, Bluetooth, power and theme controls. Smithay only composes and positions it.

Requirements

Requirement: Protected panel with no native controls

The indicators in the right corner of the bar SHALL form a single clickable segment that opens a web panel protected by the Electron host. Smithay SHALL compose and position the window and MUST NOT draw controls in Rust, and the HTML of the custom interface and of isolated components MUST NOT receive the panel token or privileged access. Full text: section Introduction.

Scenario: Isolated HTML asks for the panel

  • WHEN generated or isolated HTML runs next to the panel
  • THEN it does not receive the panel token or privileged access

Requirement: Closing and sizing

Escape SHALL close the submenu and return focus to the control that opened it, and a click outside closes the submenu or panel. The panel resizes its height to the content, limited by the panel declaration, and Smithay also limits the client geometry to the area and to the configured maximum. Full text: section Appearance and interaction.

Scenario: Escape in a submenu

  • WHEN a submenu is open and the user presses Escape
  • THEN the submenu closes and focus returns to the control that opened it

Requirement: Security of the panel routes

The panel routes SHALL use host authentication and check typed controls and actions, and MUST NOT receive an executable, shell, path or arbitrary arguments from the renderer. Failures and missing permissions MUST NOT become success, and old responses MUST NOT replace newer mutations. Full text: section Security and state updates.

Scenario: Failed protected operation

  • WHEN a protected operation fails or lacks permission
  • THEN the panel does not report success

Requirement: Per-application mixer limits

Only the stream id, the application name, the loudest channel and the mute flag SHALL reach the renderer; titles such as media.name MUST never reach it. The core SHALL accept a write only for a stream in the current list, with an integer volume from 0 to 100. Full text: section Capabilities.

Scenario: Write for an unknown stream

  • WHEN a volume write names a stream that is not in the current list
  • THEN the core does not accept it

Requirement: Microphone read does not capture

The microphone row SHALL appear only while PipeWire reports an active input stream, and the read uses only the metadata of pactl list source-outputs short and MUST NOT start capture. Full text: section Capabilities.

Scenario: No input stream

  • WHEN PipeWire reports no active input stream
  • THEN the microphone level and mute do not appear in the main row

Requirement: Media card control

The core SHALL talk to the user session bus through busctl --user and never through a shell. POST /api/quick-settings/media-action MUST accept only {action: play|pause|next|previous, player} with a listed org.mpris.MediaPlayer2.* bus name, and the card MUST hide every button that the player does not support. Full text: section Capabilities.

Scenario: Player without control

  • WHEN a player reports CanControl=false
  • THEN the card hides all of its buttons

Requirement: Network credentials stay protected

Network credentials MUST NOT pass through the renderer, argv or logs; NetworkManager SHALL use its protected secret flow. Enterprise and WEP networks open the editor on the specific profile. Full text: section Capabilities.

Scenario: Connecting to a secured network

  • WHEN the user connects to a secured Wi-Fi network
  • THEN the credentials follow the NetworkManager secret flow and not the renderer, argv or logs

Requirement: Power actions confirm, lock does not

Suspend, log out, restart and shut down SHALL require confirmation. Screen lock from the session menu ("Bloquear tela") and Super+L SHALL need no confirmation. Full text: section Capabilities.

Scenario: Shut down

  • WHEN the user chooses shut down
  • THEN a confirmation is required before the action runs

Requirement: Theme and airplane mode

The theme control SHALL switch the system scheme through GSettings, and an explicit Matugen palette takes precedence over the light or dark scheme. Airplane mode SHALL respect the physical block read from rfkill. Full text: section Capabilities.

Scenario: Explicit Matugen palette

  • WHEN an explicit Matugen palette exists
  • THEN it takes precedence over the light or dark scheme

Requirement: Source deadline of the snapshot

Each source of the snapshot SHALL have its own deadline of 1 s (sourceWaitMs); a source that misses it MUST report {available: false}, its command is killed through an abort signal, and the other sources arrive on time. The core keeps no last good value for a slow source, except the media card. Full text: section Startup and reopening of the panel.

Scenario: Stopped service

  • WHEN NetworkManager, bluetoothd or PipeWire is stopped
  • THEN the panel is delayed by 1 s at most and no hung process remains

Requirement: Hidden panel stays idle

While hidden, the protected window SHALL NOT measure its height and MUST NOT query the full snapshot of the devices, and it keeps events to follow the theme. Confirmations and submenus are discarded when it hides. Full text: section Startup and reopening of the panel.

Scenario: Reopening

  • WHEN the panel opens again after being hidden
  • THEN the data is updated without rebuilding the document

Requirement: First frame geometry

The surface commit SHALL resolve the declared geometry of the panel before the first configure, and without a client size it MUST use the declared dimensions and not configure a 1 px window. Full text: section Position in the first frame.

Scenario: Commit with no buffer

  • WHEN the surface commits before any buffer exists
  • THEN the declared dimensions are used for the configure

Requirement: Volume indicator never takes input

The volume-indicator panel SHALL never take keyboard focus (keyboard: false) and SHALL ignore the pointer, so it cannot open the conversation or steal clicks. It shows only when the percentage or the mute flag differs from the last read, for 1.5 seconds after a change. Full text: section Volume indicator.

Scenario: Unrelated sink event

  • WHEN a sink event arrives and neither the percentage nor the mute flag changed
  • THEN the indicator stays silent

Status

Doc status: current contract. Protected quick settings panel; now on shadcn/ui. Checked 2026-11-10.

Introduction

The indicators in the right corner of the bar (connectivity, battery, date and clock) form a single rounded clickable segment that opens a web panel protected by the Electron host. There is no separate settings icon, and the text of the indicators cannot be selected. Since HeroUI phase 5 (openspec/changes/archive/2026-11-02-heroui-migration/design.md) the panel is React and HeroUI, built from ui-src/host/quick-settings.jsx on the shared panel runtime shadcn-panel.js, with Gravity UI icons and own SVG icons for Wi-Fi, Bluetooth, battery and the power saver (ui-src/host/system-icons.jsx); it uses the Ubuntu font family. Since phase 9 the top bar uses the same icons, and the Yaru icon files are gone. Smithay composes and positions the window; it does not draw controls in Rust. The HTML of the custom interface and of isolated components does not receive the panel token or privileged access.

Appearance and interaction

The update in progress takes as reference the locally installed GNOME Shell 46 and Yaru 24.04: a compact panel aligned to the right, two groups of tiles, sliders above the tiles, the active state in the accent color of the shared palette, a system row with battery/settings/session actions, and submenus anchored to the tile over the darkened content. Escape closes the submenu and returns focus to the control that opened it; a click outside closes the submenu/panel. The panel resizes its height to the content, limited by the panel declaration; Smithay also limits the client geometry to the area and to the configured maximum. This prevents a large transparent area from intercepting clicks.

Since 2026-10-31 the panel follows the bar design: hover changes the background of tiles and buttons (--color-hover, or --color-accent-hover on active tiles) instead of a brightness filter, spacing uses the --space-* scale, and submenus and the confirmation use a 12px radius inside the 13.5px panel. See the bar design. Since 2026-11-03 (phase 2 of the style unification) the panel takes the shared panel base host/panel-base.css and the design scale: the glass surface .panel-surface with a 16px radius (--radius-surface), submenus and the confirmation as the raised surface with the same radius, 16px icons, and the control heights --panel-control-* and --panel-tile-height; see the panel pages.

Capabilities

  • Audio: output volume/mute, output device choice and input selection. The microphone level/mute appears in the main row only while PipeWire reports an active input stream; the Som (Sound) submenu lets you choose the device. The read uses only the metadata of pactl list source-outputs short and does not start capture. PipeWire video sources do not appear as microphones.
  • Per-application mixer: the Som (Sound) submenu lists the playback streams under "Aplicativos" (Applications), each with a volume slider and a mute button. The read is pactl --format=json list sink-inputs and the writes are pactl set-sink-input-volume ID N% and pactl set-sink-input-mute ID 1|0. Only the stream id, the application name (application.name, then the binary name), the loudest channel and the mute flag reach the renderer; titles such as media.name never do. The core accepts a write only for a stream in the current list, with an integer volume from 0 to 100. Rows update in place on audio events, and a slider that the user drags is not overwritten. A stream that appears or ends changes the list without a reload. A key that repeats on a slider while a change applies sends no change for those repeats, because the slider is disabled until the readback; the next key press sends again.
  • Media card: a compact card at the top of the panel shows the title and artist of one MPRIS player, with previous, play/pause and next. The core talks to the user session bus through busctl --user (the tool it already uses for logind), never through a shell. It reads PlaybackStatus, Metadata, CanPlay, CanPause, CanGoNext, CanGoPrevious and CanControl, and the card hides every button that the player does not support. CanControl=false hides all of them. With several players the card follows the one that started playing last; a playing player always beats a paused one. The card disappears when no player is on the bus. POST /api/quick-settings/media-action accepts only {action: play|pause|next|previous, player} where player is a listed org.mpris.MediaPlayer2.* bus name; the core reads the capability again before it calls the method. A monitor on the same bus (busctl --user monitor with two match rules) reports property changes and players that appear or leave as the media event, and the panel then reads only GET /api/quick-settings/media, not the full snapshot. Seek position and cover art are not part of this delivery.
  • Volume indicator: see Volume indicator.
  • Brightness: backlight through sysfs and logind SetBrightness. The keyboard backlight control appears only when a suitable device exists.
  • Network: Wi-Fi on/off, available networks, connect/disconnect and readback; Ethernet on/off; existing VPN profiles connect/disconnect. Advanced configuration opens the system applications. SSIDs with escaped separators are preserved. Credentials do not pass through the renderer, argv or logs: NetworkManager uses its protected secret flow. Enterprise/WEP networks open the editor on the specific profile.
  • Bluetooth: radio, paired devices connect/disconnect, and a new pairing opens Configurações Bluetooth (Bluetooth settings). The snapshot asks bluetoothctl show only when the kernel lists an adapter (/sys/class/bluetooth/hci*). Without bluetoothd, that command waits until the 5 s kill, and the snapshot waits for every source: on a host with no adapter (2026-11-01) each snapshot took 5.0 s and the panel kept its controls disabled that long at each opening and after each change. Now it takes about 0.1 s and Bluetooth reads as unavailable. With an adapter and a stopped bluetoothd, the source deadline of the snapshot ends the read after 1 s.
  • Airplane mode: turns off the available radios and respects the physical block read from rfkill; missing adapters are handled individually.
  • Power: the battery opens Configurações de energia (Power settings). The battery button shows only when the system has a battery (it starts hidden until the first read), as the top bar indicator does; the power profile has a separate tile/submenu and a readback of power-profiles-daemon. Suspend, log out, restart and shut down require confirmation.
  • Theme: switches the system scheme through GSettings. The light/dark scheme feeds the same palette as the chat, bar and controls; an explicit Matugen palette takes precedence. The personal chat CSS stays isolated in the ShadowRoot. See the shared palette.

The system row has a "Captura de tela" (screenshot) button before the settings button. It asks the core to open the protected screenshot UI (POST /api/screenshot/open), then closes the quick settings, so they are not in the image. See screenshots.

Screen lock is available from the session menu as "Bloquear tela" (lock screen), and from Super+L. It needs no confirmation, because it changes and loses nothing. The compositor hides the desktop and a protected web page asks for the password, which PAM checks. See the lock screen for the contract, the security properties and what is not proven. User switching and night light are not part of this delivery and remain pending. None of these actions is simulated.

Security and state updates

The panel routes use host authentication and check typed controls/actions. They do not receive an executable, shell, path or arbitrary arguments from the renderer. Protected operations share a lock in the core and do a readback; failures/missing permissions do not become success. Old responses must not replace newer mutations. Authenticated SSE monitors cover NetworkManager, PipeWire, BlueZ, MPRIS players on the user bus and the color scheme; they end when the last client closes. Brightness, keyboard and rfkill use readback polling every 15 seconds, because inotify notifications on sysfs attribute files are not reliable. The panel also updates when it becomes visible again.

Validation of this update

Automated validation on 2026-10-27: npm run format:check, npm run check, npm test (113/113), cargo fmt --check, cargo test --locked (19/19), Clippy with -D warnings and cargo build --locked passed. The tests cover parsing, authentication, locks, simulated services, events/cleanup, icons and geometry limits.

Validation in the browser with a loopback fixture: light/dark states, audio, Wi-Fi and Bluetooth submenus, selection/connection readback, focus, Escape, the power dialog/cancellation and a narrow viewport were exercised. The microphone row appeared with an active stream and disappeared after the fixture became inactive, without reloading the page. The fixture is synthetic and did not change the real network or devices. This browser proof does not prove operation through the current Electron host, nor control of the physical devices.

Local read: QuickSettings.snapshot() queried the real services without running mutations and returned audio, brightness, Wi-Fi, Bluetooth, battery, power, airplane mode, theme and available profiles; keyboard backlight and Ethernet were unavailable on this host. This is only a read by the core, with no proof that the current host or the Smithay window use the new assets.

Electron and compositor in the session: do not restart or replace the shared runtime during this change. The sizing change requires a new Smithay binary, so the proof of client geometry in that session can only happen after coordinated preparation/activation and a new login. Until then, do not declare the physical update delivered. Commands required in the web-shell directory: npm ci, npm run format:check, npm run check, npm test; for Rust: cargo fmt --check, cargo test --locked, cargo clippy --locked --all-targets -- -D warnings and cargo build --locked in the native/smithay directory.

Startup and reopening of the panel

The protected HTML receives the system theme before it is served. If the query is not available, the CSS uses the color preference of the browser; a later read failure does not switch an already set theme to light.

The host keeps the protected window when it closes by click, Escape or loss of focus, and reuses the same renderer on the next opening. Isolated panels are still destroyed on close. Removing the declaration or ending the host also destroys the protected window. While hidden, it does not measure the height and does not query the full snapshot of the devices; it keeps events to follow the theme. Confirmations and submenus are discarded when it hides. On reopening, the data is updated without rebuilding the document.

Wi-Fi and power permissions query independent data in parallel. The snapshot shares the radio reads with airplane mode only within that query, with no persistent cache of device state. Events received during a pending query schedule another read right after it. A burst of events waits 80 ms and ends in one read, and a read that starts cancels the pending timer, so no second read follows it at once.

Each source of the snapshot has its own deadline of 1 s (sourceWaitMs). A source that misses it reports {available: false} for that snapshot, its command is killed through an abort signal, and the other sources arrive on time. The font list of the typography source is the exception: it keeps its own 2 s timeout and ends by itself. The connectivity read that the bar polls (/api/connectivity) gives Wi-Fi and Bluetooth the same deadline. Airplane mode reports {available: false} when either radio missed its deadline, because the state of that radio is unknown. The core keeps no last good value for a slow source, except the media card, which keeps its own short wait and its last answer. Snapshots share one media read in flight, and the player list call has a 2 s bus timeout, so a hung session bus keeps one set of processes at most. Measured on the development host (2026-11-01), the sources take 10 to 40 ms, and powerprofilesctl takes about 100 ms. A stopped bluetoothd, NetworkManager or PipeWire therefore delays the panel by 1 s at most, not by the 5 s kill of the command, and leaves no hung process behind.

QA: lifecycle tests cover reuse, loss of focus, removal and shutdown; service tests cover sharing and parallelism. In the browser, the light/dark themes and the fallback were checked with a device response delayed by 700 ms, a failed theme read and a theme event while hidden. The paint preserved the theme; this does not measure the physical latency of the desktop.

Position in the first frame

The surface commit resolves the declared geometry of the panel before the first configure, even when there is no buffer yet. Without a client size, it uses the declared dimensions; it does not configure a 1 px window. Each frame also reconciles the position of the known panels before it builds the scene, covering metadata that arrived after the commit. The real position is restored on remap, even when the desired rectangle did not change.

This removes the dependency on the 30 ms IPC timer to leave the temporary position (32, 32). The interface stays web; only positioning/composition change in Smithay. The fix requires the new compositor binary at a next login; reloading Electron does not replace the existing compositor.

Verification of the fix: 57 Rust tests passed and five explicit EGL tests were ignored; formatting and Clippy with warnings as errors passed. The 184 Node tests passed, with isolation from the real desktop. Visual acceptance of the new positioning remains pending a login with the updated compositor.

Volume indicator

The volume-indicator panel shows the default output volume or "Mudo" (Muted) for 1.5 seconds after a change. It is a protected web panel above the bottom bar. Its declaration keeps bottom-right with offset 40, and the compositor places that exact default at the bottom center. Since 2026-10-31 quick settings opens from the top bar, under its right end, and the notification toasts show at the top center. It never takes keyboard focus (keyboard: false) and ignores the pointer, so it cannot open the conversation or steal clicks. Its declaration uses auto_open: true, so the bar shows no button for it.

The page reacts to events. The core runs one pactl subscribe while the indicator listens (GET /api/quick-settings/volume-events), and from the first top bar reading on, because the bar view counts the volume events (revisions.volume) instead of holding its own stream. It publishes only change and new lines for a sink or for the server, with a 30 ms debounce. After each event the page reads GET /api/quick-settings/volume. The first read is a baseline. The indicator shows only when the percentage or the mute flag differs from the last read, so unrelated sink events stay silent. A burst of events during a slider drag becomes one extra read. The stream reconnects with backoff, and the first read after a gap shows the indicator only if the value changed. The page restarts the 1.5 second timer on each change.

The window is created hidden. The page writes anos-panel:visible or anos-panel:hidden to the console, and the Electron main process shows it with showInactive() or hides it. This is the only channel from a renderer without a preload script to the host. Only a registry-known protected panel can be transient. The page draws the new value before it asks to be shown. Since HeroUI phase 3 (openspec/changes/archive/2026-11-02-heroui-migration/design.md) the page is React and HeroUI: a Gravity UI volume icon and a HeroUI Meter, built from ui-src/host/volume-indicator.jsx on the shared panel runtime shadcn-panel.js. It renders with flushSync, so the new value is still in the DOM before the marker.

A core of the real desktop appends this declaration once to an existing web-panels.json that lacks it (see notifications). To add it by hand, put it in the panels list, then wait for the host to reread the file (about one second). Old compositors accept it, because it uses only version 1 keys:

{
  "id": "volume-indicator",
  "title": "Indicador de volume",
  "kind": "protected",
  "source_root": "/home/YOUR_USER/.local/share/agent-native-os/interface/host",
  "anchor": "bottom-right",
  "width": 280,
  "height": 72,
  "offset_x": 0,
  "offset_y": 40,
  "keyboard": false,
  "auto_open": true,
  "close_on_blur": false
}

New configurations written by scripts/link-interface.py and the default registry already contain it. A bottom-center placement needs a new bottom-center anchor in the compositor and is not part of this delivery.

Validation of media and audio (2026-10-31)

  • Parsers: synthetic pactl --format=json and busctl --json=short samples cover missing names, raw values, control characters, limits, invalid JSON, capability flags and the player choice.
  • Private bus: web-shell/test/media-audio.test.js starts its own dbus-daemon with a config that has no service directories, and a synthetic player (web-shell/test/fixtures/fake-mpris-player.py, run with the system python3-dbus). It checks the choice of player, Play/Previous calls, refusal of unsupported controls before any D-Bus call, and media events for property changes and for a player that leaves. The test skips when dbus-daemon, busctl or python3-dbus is missing. testEnvironment() now points DBUS_SESSION_BUS_ADDRESS at a path that does not exist, so a synthetic core cannot reach the user's bus.
  • Browser: a synthetic core (private bus, two fake players, fake wpctl and pactl in a temporary PATH, no real audio server) served the real panel assets. The media card toggled pause/play through the player, switched to the player that started last with its own buttons, and followed external play without a reload. The mixer changed a stream volume and a mute through the fake pactl, and an external change updated the open list. The indicator page showed 65% and then the muted state on fake sink events, stayed silent for unchanged values, and its console markers were 1500 ms apart.
  • Not proven: the Electron host (the console-message bridge, showInactive, the transparent window on the Smithay surface), the position above the real bar, real PipeWire or a real player, and a login with the new assets. The host and the core need a coordinated restart to load this change.