support monitor lid option to disable closed monitors

This commit is contained in:
2025-01-01 18:02:56 +00:00
parent 20ec42d126
commit 818df0f7e8
6 changed files with 156 additions and 62 deletions

View File

@@ -12,7 +12,7 @@ Example `config.kdl`:
```kdl
// This is my laptop's built-in screen.
monitor "laptop" make="Unknown" model="0x403D" serial="0x00000000"
monitor "laptop" make="Unknown" model="0x403D" serial="0x00000000" lid="LID"
// I usually have it hooked up to this monitor, which is the top one on my desk.
monitor "top" make="Dell Inc." model="DELL U2415" serial="CFV9N99T0Y0U"
@@ -35,6 +35,9 @@ Printed layouts include:
* All layouts defined in `config.kdl` for which the monitors are currently available. E.g.: `two4k`.
* All monitors defined in `config.kdl` that are currently available. E.g.: `laptop`, `left`, `right`.
* All available outputs that are not matched by a configured monitor. E.g.: `HDMI-2`.
If a monitor has its `lid` property is set to the name of a directory in `/proc/acpi/button/lid/`, if the `state` file
in that directory indicates that the lid is closed, the monitor will not be considered available.
If you pass a layout name (or monitor name, or output name) as a command line argument to `swayout`,
it calls `swaymsg` to configure that layout.