diff --git a/komorebi/src/static_config.rs b/komorebi/src/static_config.rs index da5c2c58..751b54e4 100644 --- a/komorebi/src/static_config.rs +++ b/komorebi/src/static_config.rs @@ -206,7 +206,6 @@ impl From<&Workspace> for WorkspaceConfig { .name() .clone() .unwrap_or_else(|| String::from("unnamed")), - custom_layout: None, layout: value .tile() .then_some(match value.layout() { @@ -214,13 +213,25 @@ impl From<&Workspace> for WorkspaceConfig { Layout::Custom(_) => None, }) .flatten(), + custom_layout: value + .workspace_config() + .as_ref() + .and_then(|c| c.custom_layout.clone()), layout_rules: Option::from(layout_rules), - // TODO: figure out how we might resolve file references in the future - custom_layout_rules: None, + custom_layout_rules: value + .workspace_config() + .as_ref() + .and_then(|c| c.custom_layout_rules.clone()), container_padding, workspace_padding, - initial_workspace_rules: None, - workspace_rules: None, + initial_workspace_rules: value + .workspace_config() + .as_ref() + .and_then(|c| c.initial_workspace_rules.clone()), + workspace_rules: value + .workspace_config() + .as_ref() + .and_then(|c| c.workspace_rules.clone()), apply_window_based_work_area_offset: Some(value.apply_window_based_work_area_offset()), window_container_behaviour: *value.window_container_behaviour(), window_container_behaviour_rules: Option::from(window_container_behaviour_rules), diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 79f326f5..13cbb817 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -92,6 +92,8 @@ pub struct Workspace { window_container_behaviour_rules: Option>, #[getset(get = "pub", get_mut = "pub", set = "pub")] float_override: Option, + #[getset(get = "pub", set = "pub")] + workspace_config: Option, } impl_ring_elements!(Workspace, Container); @@ -118,6 +120,7 @@ impl Default for Workspace { window_container_behaviour: None, window_container_behaviour_rules: None, float_override: None, + workspace_config: None, } } } @@ -209,6 +212,8 @@ impl Workspace { self.set_float_override(config.float_override); self.set_layout_flip(config.layout_flip); + self.set_workspace_config(Some(config.clone())); + Ok(()) }