Skip to content

Conversation

@multiplex55
Copy link
Owner

Motivation

  • Provide a compact dashboard widget offering common system controls (brightness slider, volume slider + mute toggle, and power plan selector) and surface current system state.
  • Reuse existing action/launcher hooks where available and add minimal helpers where needed to query and set system state.

Description

  • Add a new widget SystemControlsWidget at src/dashboard/widgets/system_controls.rs that uses a TimedCache to refresh and render brightness, volume/mute, and power-plan controls and shows per-control fallback/error messages when features are unavailable.
  • Expose system helpers in src/actions/system.rs: get_system_volume, get_system_mute, get_main_display_brightness, get_power_plans, set_power_plan and a PowerPlan struct, plus a Windows-only parser parse_powercfg_list for powercfg /L output.
  • Wire new actions into the launcher and action parsing in src/launcher.rs: add ActionKind::VolumeToggleMute and ActionKind::PowerPlanSet, parse volume:toggle_mute and power:plan:set:<guid>, call system::toggle_system_mute() and system::set_power_plan() in the dispatch path, and add a toggle_system_mute helper in the launcher implementation.
  • Register the widget in the dashboard registry by updating src/dashboard/widgets/mod.rs and implement UI behavior to dispatch the existing action strings (e.g. brightness:set:<n>, volume:set:<n>, volume:toggle_mute, power:plan:set:<guid>).

Testing

  • Added unit tests covering action parsing and powercfg output parsing (src/launcher.rs tests for parsing new action prefixes and src/actions/system.rs Windows-only test for parse_powercfg_list).
  • Ran cargo test --lib in this environment but the build failed before executing tests due to a missing system library required by alsa-sys (pkg-config/alsa.pc not present), so the new unit tests were not executed here.
  • Local/unit test intent: cargo test --lib (would run added parse tests); execution blocked by environment dependency failure as noted above.

Codex Task

@multiplex55 multiplex55 merged commit 5b92f19 into master Jan 17, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/add-system-control-dashboard-widget branch January 17, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants