mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-07 13:35:14 +02:00
feat(cli): add focused-container-kind state query
This commit adds a new StateQuery variant, FocusedContainerKind, which will will return None if there is not focused container on the current workspace (ie. it is empty), Single if the focused container contains a single window, or Stack if the focused container contains more than one window.
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ Usage: komorebic.exe query <STATE_QUERY>
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
<STATE_QUERY>
|
<STATE_QUERY>
|
||||||
[possible values: focused-monitor-index, focused-workspace-index, focused-container-index, focused-window-index, focused-workspace-name, focused-workspace-layout, version]
|
[possible values: focused-monitor-index, focused-workspace-index, focused-container-index, focused-window-index, focused-workspace-name, focused-workspace-layout, focused-container-kind, version]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help
|
-h, --help
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# toggle-shortcuts
|
||||||
|
|
||||||
|
```
|
||||||
|
Toggle the komorebi-shortcuts helper
|
||||||
|
|
||||||
|
Usage: komorebic.exe toggle-shortcuts
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-h, --help
|
||||||
|
Print help
|
||||||
|
|
||||||
|
```
|
||||||
@@ -8,7 +8,7 @@ Usage: komorebic.exe window-hiding-behaviour <HIDING_BEHAVIOUR>
|
|||||||
Arguments:
|
Arguments:
|
||||||
<HIDING_BEHAVIOUR>
|
<HIDING_BEHAVIOUR>
|
||||||
Possible values:
|
Possible values:
|
||||||
- hide: Use the SW_HIDE flag to hide windows when switching workspaces (has issues with Electron apps)
|
- hide: END OF LIFE FEATURE: Use the SW_HIDE flag to hide windows when switching workspaces (has issues with Electron apps)
|
||||||
- minimize: Use the SW_MINIMIZE flag to hide windows when switching workspaces (has issues with frequent workspace switching)
|
- minimize: Use the SW_MINIMIZE flag to hide windows when switching workspaces (has issues with frequent workspace switching)
|
||||||
- cloak: Use the undocumented SetCloak Win32 function to hide windows when switching workspaces
|
- cloak: Use the undocumented SetCloak Win32 function to hide windows when switching workspaces
|
||||||
|
|
||||||
|
|||||||
@@ -341,6 +341,7 @@ pub enum StateQuery {
|
|||||||
FocusedWindowIndex,
|
FocusedWindowIndex,
|
||||||
FocusedWorkspaceName,
|
FocusedWorkspaceName,
|
||||||
FocusedWorkspaceLayout,
|
FocusedWorkspaceLayout,
|
||||||
|
FocusedContainerKind,
|
||||||
Version,
|
Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1456,6 +1456,18 @@ impl WindowManager {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
StateQuery::FocusedContainerKind => {
|
||||||
|
match self.focused_workspace()?.focused_container() {
|
||||||
|
None => "None".to_string(),
|
||||||
|
Some(container) => {
|
||||||
|
if container.windows().len() > 1 {
|
||||||
|
"Stack".to_string()
|
||||||
|
} else {
|
||||||
|
"Single".to_string()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
reply.write_all(response.as_bytes())?;
|
reply.write_all(response.as_bytes())?;
|
||||||
|
|||||||
Reference in New Issue
Block a user