From 8d43efe4ac38ddb6ce298d6fbdfc3ec610b8da56 Mon Sep 17 00:00:00 2001 From: lualeet <43719546+lualeet@users.noreply.github.com> Date: Sat, 29 Mar 2025 10:13:59 +0000 Subject: Add option 'focus-at-startup' to focus a chosen output on start (#1323) * Implement default-output * Fix incorrect wiki string * Center mouse on start * Move default-output to Output.focus-at-startup * fixes --------- Co-authored-by: lualeet Co-authored-by: Ivan Molodetskikh --- wiki/Configuration:-Outputs.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'wiki/Configuration:-Outputs.md') diff --git a/wiki/Configuration:-Outputs.md b/wiki/Configuration:-Outputs.md index 22e1c639..2a2ee4cf 100644 --- a/wiki/Configuration:-Outputs.md +++ b/wiki/Configuration:-Outputs.md @@ -13,6 +13,7 @@ output "eDP-1" { transform "90" position x=1280 y=0 variable-refresh-rate // on-demand=true + focus-at-startup background-color "#003300" } @@ -164,6 +165,28 @@ output "HDMI-A-1" { } ``` +### `focus-at-startup` + +Since: next release + +Focus this output by default when niri starts. + +If multiple outputs with `focus-at-startup` are connected, they are prioritized in the order that they appear in the config. + +When none of the connected outputs are explicitly `focus-at-startup`, niri will focus the first one sorted by name (same output sorting as used elsewhere in niri). + +```kdl +// Focus HDMI-A-1 by default. +output "HDMI-A-1" { + focus-at-startup +} + +// ...if HDMI-A-1 wasn't connected, focus DP-2 instead. +output "DP-2" { + focus-at-startup +} +``` + ### `background-color` Since: 0.1.8 -- cgit