diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-29 10:39:21 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | 3c2e1554c6f1fe0d7d96094aa93f72f4ced613e5 (patch) | |
| tree | 9b3c883f1f3256e49250bb5c26716ebcf1a38bba /niri-config/src | |
| parent | 744955ba69176a0e2937f18958908274583223d4 (diff) | |
| download | niri-3c2e1554c6f1fe0d7d96094aa93f72f4ced613e5.tar.gz niri-3c2e1554c6f1fe0d7d96094aa93f72f4ced613e5.tar.bz2 niri-3c2e1554c6f1fe0d7d96094aa93f72f4ced613e5.zip | |
Add default-floating-position window rule
Diffstat (limited to 'niri-config/src')
| -rw-r--r-- | niri-config/src/lib.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index cfc1853c..747ae9cb 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -1019,6 +1019,8 @@ pub struct WindowRule { pub block_out_from: Option<BlockOutFrom>, #[knuffel(child, unwrap(argument))] pub variable_refresh_rate: Option<bool>, + #[knuffel(child)] + pub default_floating_position: Option<FoIPosition>, } #[derive(knuffel::Decode, Debug, Default, Clone, PartialEq)] @@ -1082,6 +1084,14 @@ pub struct BorderRule { pub inactive_gradient: Option<Gradient>, } +#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)] +pub struct FoIPosition { + #[knuffel(property)] + pub x: FloatOrInt<-65535, 65535>, + #[knuffel(property)] + pub y: FloatOrInt<-65535, 65535>, +} + #[derive(Debug, Default, PartialEq)] pub struct Binds(pub Vec<Bind>); @@ -3192,6 +3202,7 @@ mod tests { open-floating false open-focused true default-window-height { fixed 500; } + default-floating-position x=100 y=-200 focus-ring { off @@ -3476,6 +3487,10 @@ mod tests { open_floating: Some(false), open_focused: Some(true), default_window_height: Some(DefaultPresetSize(Some(PresetSize::Fixed(500)))), + default_floating_position: Some(FoIPosition { + x: FloatOrInt(100.), + y: FloatOrInt(-200.), + }), focus_ring: BorderRule { off: true, width: Some(FloatOrInt(3.)), |
