Skip to content

feat: run a different preset on each monitor and cycle presets - #11

Merged
opariffazman merged 1 commit into
feat/presetsfrom
feat/per-monitor-presets
Nov 3, 2026
Merged

opariffazman merged 1 commit into
feat/presetsfrom
feat/per-monitor-presets

Conversation

@opariffazman

Copy link
Copy Markdown
Contributor

Stacked on #10. The base is `feat/presets`, so the diff shows only this change. Retarget to `main` after #10 merges.

What changes

  • Each monitor shows its own layout and preset. The page sends `?screen=KEY` on every request, and the server keeps one stage per monitor in `screens.json` (up to 16).
  • A new monitor starts as a copy of the default stage. A lone monitor uses the default stage, so single-screen setups behave as before.
  • A command with no `screen` reaches every stage. A named screen reaches that stage only, and an unknown name answers 404.
  • New commands: `next-preset`, `prev-preset`, `screens`. They step from the preset the stage loaded last, wrap, and skip a preset with no model left.
  • CLI: `--screen KEY` and `--screen current`. `current` reads the active monitor from KWin, so a global shortcut cycles the monitor in use.
  • The Presets pane has Previous and Next buttons and highlights the preset loaded last. Local mode gets the same commands.

Monitor keys

The page builds the key from the screen size and position when `screen.isExtended` is true, for example `3440x1440+0+0`. `?screen=NAME` overrides it. A moved monitor gets a new key and starts again from the default layout.

Tests

  • Python: 355 tests pass (28 new in `tests/server/test_screens.py`).
  • Page: 79 tests pass (4 new in `screens.spec.mjs`, 1 new in `local.spec.mjs`).
  • shellcheck passes.
  • Checked on the real desktop with two monitors: each steps its own preset, and `--screen current` moves only the monitor the pointer is on.

Notes

  • KDE's shortcut service keeps the command line it first read for a shortcut file. Changing `Exec` later has no effect until the next login. Register a shortcut under a new file name instead. This is why docs name `--screen current` in the command to bind.
  • `save-preset` without `--screen` saves the default layout. Name the monitor on a multi-monitor desktop.

Each wallpaper page names its monitor, and the server keeps one stage per
monitor in screens.json. A monitor starts as a copy of the default stage.
A command without a screen still reaches every stage, so a lone monitor
and the old CLI calls behave as before.

Add next-preset and prev-preset, a screens command, and --screen KEY on
the CLI. --screen current picks the monitor KWin reports as active, so a
global shortcut cycles the monitor in use. The Presets pane gets Previous
and Next buttons.
@opariffazman
opariffazman merged commit 079b733 into feat/presets Nov 3, 2026
4 checks passed
@opariffazman
opariffazman deleted the feat/per-monitor-presets branch November 3, 2026 16:00
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