feat: size: prefix, external auto-detection, auto-disable stale monitors

- size:WxH and size:WxH@R resolution for config names
- auto-detection of external monitors when external list is empty (any non-internal display)
- ensureCleanLayout: explicitly disable connected monitors not in target layout
- update docs (README, example.yaml) for all three features
This commit is contained in:
Maksim Totmin
2026-06-24 19:51:18 +07:00
parent ac2bb77113
commit 3fdccadd3c
5 changed files with 223 additions and 54 deletions
+10 -2
View File
@@ -26,6 +26,9 @@ restore_on_exit: true
# External monitors that trigger docked mode.
# Plain name: matches the connector name (e.g. DP-1, HDMI-A-1).
# desc: prefix: matches by monitor description (survives rename).
# Optional — if omitted or left empty, the daemon auto-detects external
# monitors: any display whose connector is not eDP-/LVDS-/DSI- is treated
# as external.
external:
- DP-1
- DP-2
@@ -33,10 +36,10 @@ external:
# Monitor layouts for each mode.
# "portable" and "docked" are required.
# Each mode lists monitors with their desired configuration.
# Monitors connected but not listed in the mode are automatically disabled.
#
# Fields:
# name — connector name or desc:description
# name — connector name, desc:description, size:WxH, or size:WxH@R
# enabled — true to show, false to disable
# mode — "preferred" (auto-detect), "1920x1080@60", etc.
# position — "auto", "0x0", "1920x0", etc.
@@ -70,6 +73,11 @@ modes:
mode: "3840x2160@60"
position: "0x0"
scale: 1.5
- name: size:1920x1080@60 # resolve by resolution + refresh rate
enabled: true
mode: preferred
position: auto
scale: 1.0
# Shell commands run after a layout change.
# Commands run concurrently; failures are logged but never crash the daemon.