Skip to content

feat: add PowerMode for low-resource environments#2920

Open
carlosedsousa-dev wants to merge 12 commits into
AvengeMedia:masterfrom
carlosedsousa-dev:perf-power-mode
Open

feat: add PowerMode for low-resource environments#2920
carlosedsousa-dev wants to merge 12 commits into
AvengeMedia:masterfrom
carlosedsousa-dev:perf-power-mode

Conversation

@carlosedsousa-dev

Copy link
Copy Markdown

Motivation

DankMaterialShell has significant GPU and CPU overhead from shader effects, high-frequency timers, and continuous background monitoring. This PR adds a centralized PowerMode system to make the shell viable on low-resource hardware (2GB RAM, weak CPU).

Changes

Infrastructure

  • Add PowerMode enum (Normal, Balanced, PowerSaving) to SettingsData
  • Add powerMode setting with persistence
  • Add syncPowerModeWithSystem for automatic switching via system power profile
  • Add Performance Mode selector in Settings → Typography & Motion

PowerSaving optimizations

  • Elevation: M3 elevation shadows disabled
  • Animations: All animation durations forced to None, ripple effects disabled
  • Shaders: Parallax live source disabled, blurMax reduced (96→48), textureSize halved
  • Timers: groupsDebounce 16→50ms, holdTimer 16→32ms, seekbar 80→200ms, scrollTimer 50→150ms, DgopService 3000→5000ms, blob animation disabled
  • Desktop widgets: Filter disabled instances from Instantiator (bonus lazy-loading fix)

Dev tooling

  • Add mise.toml for dev tool version management
  • Add .github/PULL_REQUEST_TEMPLATE.md

Testing

  • Tested on Niri compositor
  • Normal mode: zero regression
  • PowerSaving mode: elevation, animations, shaders, timers all degrade correctly
  • Switching between modes works live without restart

Screenshots / Video

test.mp4

Add Normal/Balanced/PowerSaving power mode to SettingsData with
persistence and system power profile synchronization support.
Disable M3 elevation, parallax live source and reduce blurMax (96→48)
when PowerMode is PowerSaving to reduce GPU overhead.
Relax high-frequency timers to reduce CPU wake-ups:
- groupsDebounce 16→50ms, DankSeekbar 80→200ms, scrollTimer 50→150ms
- Disable DankAlbumArt blob animation entirely in PowerSaving
Add Normal/Balanced/PowerSaving button group in Typography & Motion tab
before Animation Speed, allowing users to switch PowerMode directly.
Only instantiate enabled desktop widgets instead of creating all and
hiding disabled ones, reducing startup overhead and memory usage.
- WallpaperBackground: halve textureSize for all ShaderEffectSources (less VRAM)
- PowerMenuModal: holdTimer 16→32ms (slower hold-to-confirm)
- DgopService: active polling 3000→5000ms (less frequent process stats)
- Add 75ms debounce for app search queries (Controller)
- Precompute normalized fields on desktop entry change (AppSearchService)
- Cache query results with version-based invalidation (AppSearchService)
- Skip fuzzy matching when already at max results (AppSearchService)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant