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
+5
View File
@@ -440,6 +440,8 @@ pub struct Output {
pub mode: Option<ConfiguredMode>,
#[knuffel(child)]
pub variable_refresh_rate: Option<Vrr>,
#[knuffel(child)]
pub focus_at_startup: bool,
#[knuffel(child, default = DEFAULT_BACKGROUND_COLOR)]
pub background_color: Color,
}
@@ -462,6 +464,7 @@ impl Default for Output {
fn default() -> Self {
Self {
off: false,
focus_at_startup: false,
name: String::new(),
scale: None,
transform: Transform::Normal,
@@ -3746,6 +3749,7 @@ mod tests {
}
output "eDP-1" {
focus-at-startup
scale 2
transform "flipped-90"
position x=10 y=20
@@ -4105,6 +4109,7 @@ mod tests {
on_demand: true,
},
),
focus_at_startup: true,
background_color: Color {
r: 0.09803922,
g: 0.09803922,