From 6a2c6261df130cccb5262eddf71d40b2fffcf8f9 Mon Sep 17 00:00:00 2001 From: Merlijn <32853531+ToxicMushroom@users.noreply.github.com> Date: Wed, 29 Oct 2025 07:10:38 +0100 Subject: Add support for custom modes and modelines. (#2479) * Implement custom modes and modelines Co-authored-by: ToxicMushroom <32853531+ToxicMushroom@users.noreply.github.com> * fixes * refactor mode and modeline kdl parsers. * add IPC parse checks * refactor: address feedback * fix: add missing > 0 refresh rate check * move things around * fixes * wiki fixes --------- Co-authored-by: Christian Meissl Co-authored-by: Ivan Molodetskikh --- docs/wiki/Configuration:-Outputs.md | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'docs/wiki') diff --git a/docs/wiki/Configuration:-Outputs.md b/docs/wiki/Configuration:-Outputs.md index b2b394bd..ecdee105 100644 --- a/docs/wiki/Configuration:-Outputs.md +++ b/docs/wiki/Configuration:-Outputs.md @@ -27,6 +27,10 @@ output "eDP-1" { layout { // ...layout settings for eDP-1... } + + // Custom modes. Caution: may damage your display. + // mode custom=true "1920x1080@100" + // modeline 173.00 1920 2048 2248 2576 1080 1083 1088 1120 "-hsync" "+vsync" } output "HDMI-A-1" { @@ -86,6 +90,42 @@ output "eDP-1" { } ``` +#### `mode custom=true` + +Since: next release + +You can configure a custom mode (not offered by the monitor) by setting `custom=true`. +In this case, the refresh rate is mandatory. + +> [!CAUTION] +> Custom modes may damage your monitor, especially if it's a CRT. +> Follow the maximum supported limits in your monitor's instructions. + +```kdl +// Use a custom mode for this display. +output "HDMI-A-1" { + mode custom=true "2560x1440@143.912" +} +``` + +### `modeline` + +Since: next release + +Directly configures the monitor's mode via a modeline, overriding any configured `mode`. +The modeline can be calculated via utilities such as [cvt](https://man.archlinux.org/man/cvt.1.en) or [gtf](https://man.archlinux.org/man/gtf.1.en). + +> [!CAUTION] +> Out of spec modelines may damage your monitor, especially if it's a CRT. +> Follow the maximum supported limits in your monitor's instructions. + +```kdl +// Use a modeline for this display. +output "eDP-3" { + modeline 173.00 1920 2048 2248 2576 1080 1083 1088 1120 "-hsync" "+vsync" +} +``` + ### `scale` Set the scale of the monitor. -- cgit