feat(wm): add command to create new workspace

This commit adds a new command, 'komorebic.exe new-workspace', which
will append a new, empty workspace, to the list of workspaces on the
currently focused monitor, and then switch focus to it.

Also took the opportunity to clean up some unnecessary unwraps in
komorebic/src/main.rs.

resolve #4
This commit is contained in:
LGUG2Z
2021-08-14 09:42:10 -07:00
parent 91ddb2c22b
commit b8929cbead
5 changed files with 86 additions and 90 deletions

View File

@@ -128,6 +128,10 @@ impl Monitor {
Ok(())
}
pub fn new_workspace_idx(&self) -> usize {
self.workspaces().len()
}
pub fn update_focused_workspace(&mut self) -> Result<()> {
let work_area = *self.work_area_size();