diff --git a/docs/cli/animation-style.md b/docs/cli/animation-style.md index 795cfcba..3936028b 100644 --- a/docs/cli/animation-style.md +++ b/docs/cli/animation-style.md @@ -10,9 +10,8 @@ Options: Desired ease function for animation [default: linear] - [possible values: linear, ease-in-sine, ease-out-sine, ease-in-out-sine, ease-in-quad, ease-out-quad, ease-in-out-quad, ease-in-cubic, ease-in-out-cubic, ease-in-quart, ease-out-quart, - ease-in-out-quart, ease-in-quint, ease-out-quint, ease-in-out-quint, ease-in-expo, ease-out-expo, ease-in-out-expo, ease-in-circ, ease-out-circ, ease-in-out-circ, ease-in-back, ease-out-back, - ease-in-out-back, ease-in-elastic, ease-out-elastic, ease-in-out-elastic, ease-in-bounce, ease-out-bounce, ease-in-out-bounce] + [possible values: linear, ease-in-sine, ease-out-sine, ease-in-out-sine, ease-in-quad, ease-out-quad, ease-in-out-quad, ease-in-cubic, ease-in-out-cubic, ease-in-quart, ease-out-quart, ease-in-out-quart, ease-in-quint, ease-out-quint, ease-in-out-quint, ease-in-expo, ease-out-expo, + ease-in-out-expo, ease-in-circ, ease-out-circ, ease-in-out-circ, ease-in-back, ease-out-back, ease-in-out-back, ease-in-elastic, ease-out-elastic, ease-in-out-elastic, ease-in-bounce, ease-out-bounce, ease-in-out-bounce] -a, --animation-type Animation type to apply the style to. If not specified, sets global style diff --git a/docs/cli/query.md b/docs/cli/query.md index 2f6accf4..0b377b73 100644 --- a/docs/cli/query.md +++ b/docs/cli/query.md @@ -7,7 +7,7 @@ Usage: komorebic.exe query Arguments: - [possible values: focused-monitor-index, focused-workspace-index, focused-container-index, focused-window-index, focused-workspace-name] + [possible values: focused-monitor-index, focused-workspace-index, focused-container-index, focused-window-index, focused-workspace-name, focused-workspace-layout, version] Options: -h, --help diff --git a/docs/cli/toggle-workspace-float-override.md b/docs/cli/toggle-workspace-float-override.md index 5bb8cf8f..ea01e733 100644 --- a/docs/cli/toggle-workspace-float-override.md +++ b/docs/cli/toggle-workspace-float-override.md @@ -1,8 +1,7 @@ # toggle-workspace-float-override ``` -Enable or disable float override, which makes it so every new window opens in floating mode, for the currently focused workspace. If there was no override value set for the workspace previously it takes -the opposite of the global value +Enable or disable float override, which makes it so every new window opens in floating mode, for the currently focused workspace. If there was no override value set for the workspace previously it takes the opposite of the global value Usage: komorebic.exe toggle-workspace-float-override diff --git a/komorebi/src/core/mod.rs b/komorebi/src/core/mod.rs index 9b6257b1..f24d5d5e 100644 --- a/komorebi/src/core/mod.rs +++ b/komorebi/src/core/mod.rs @@ -329,6 +329,7 @@ pub enum StateQuery { FocusedContainerIndex, FocusedWindowIndex, FocusedWorkspaceName, + FocusedWorkspaceLayout, Version, } diff --git a/komorebi/src/monitor.rs b/komorebi/src/monitor.rs index e7044bb2..26f447ec 100644 --- a/komorebi/src/monitor.rs +++ b/komorebi/src/monitor.rs @@ -165,6 +165,16 @@ impl Monitor { .unwrap_or(None) } + pub fn focused_workspace_layout(&self) -> Option { + self.focused_workspace().and_then(|workspace| { + if *workspace.tile() { + Some(workspace.layout().clone()) + } else { + None + } + }) + } + pub fn load_focused_workspace(&mut self, mouse_follows_focus: bool) -> Result<()> { let focused_idx = self.focused_workspace_idx(); for (i, workspace) in self.workspaces_mut().iter_mut().enumerate() { diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 4f822598..85d2931b 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -1378,6 +1378,19 @@ impl WindowManager { .unwrap_or_else(|| focused_monitor.focused_workspace_idx().to_string()) } StateQuery::Version => build::RUST_VERSION.to_string(), + StateQuery::FocusedWorkspaceLayout => { + let focused_monitor = self + .focused_monitor() + .ok_or_else(|| anyhow!("there is no monitor"))?; + + focused_monitor.focused_workspace_layout().map_or_else( + || "None".to_string(), + |layout| match layout { + Layout::Default(default_layout) => default_layout.to_string(), + Layout::Custom(_) => "Custom".to_string(), + }, + ) + } }; reply.write_all(response.as_bytes())?;