mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user