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 <lualeet@null.null>
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
This commit is contained in:
lualeet
2025-03-29 10:13:59 +00:00
committed by GitHub
parent 3bb7e60311
commit 8d43efe4ac
3 changed files with 53 additions and 0 deletions
+23
View File
@@ -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`
<sup>Since: next release</sup>
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`
<sup>Since: 0.1.8</sup>