diff --git a/komorebi/src/static_config.rs b/komorebi/src/static_config.rs index 0101383b..1f52dffb 100644 --- a/komorebi/src/static_config.rs +++ b/komorebi/src/static_config.rs @@ -233,6 +233,9 @@ pub struct WorkspaceConfig { /// Enable or disable float override, which makes it so every new window opens in floating mode (default: false) #[serde(skip_serializing_if = "Option::is_none")] pub float_override: Option, + /// Enable or disable tiling for the workspace (default: true) + #[serde(skip_serializing_if = "Option::is_none")] + pub tile: Option, /// Specify an axis on which to flip the selected layout (default: None) #[serde(skip_serializing_if = "Option::is_none")] pub layout_flip: Option, @@ -281,6 +284,8 @@ impl From<&Workspace> for WorkspaceConfig { } }); + let tile = if *value.tile() { None } else { Some(false) }; + Self { name: value .name() @@ -318,6 +323,7 @@ impl From<&Workspace> for WorkspaceConfig { window_container_behaviour: *value.window_container_behaviour(), window_container_behaviour_rules: Option::from(window_container_behaviour_rules), float_override: *value.float_override(), + tile, layout_flip: value.layout_flip(), floating_layer_behaviour: value.floating_layer_behaviour(), wallpaper: None, diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 5781e6dc..91d21cc6 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -208,18 +208,16 @@ impl Workspace { if let Some(layout) = &config.layout { self.layout = Layout::Default(*layout); - self.tile = true; } if let Some(pathbuf) = &config.custom_layout { let layout = CustomLayout::from_path(pathbuf)?; self.layout = Layout::Custom(layout); - self.tile = true; } - if config.custom_layout.is_none() && config.layout.is_none() { - self.tile = false; - } + self.tile = + !(config.custom_layout.is_none() && config.layout.is_none() && config.tile.is_none() + || config.tile.is_some_and(|tile| !tile)); let mut all_layout_rules = vec![]; if let Some(layout_rules) = &config.layout_rules {