feat(cli): add last focused workspace cmd

This commit adds a new komorebic command, focus-last-workspace, which
switches to the last focused workspace on the focused monitor (if there
is one).
This commit is contained in:
LGUG2Z
2024-01-11 18:51:39 -08:00
parent 8f30612220
commit d6e83e1778
5 changed files with 70 additions and 12 deletions

View File

@@ -35,6 +35,9 @@ pub struct Monitor {
work_area_offset: Option<Rect>,
workspaces: Ring<Workspace>,
#[serde(skip_serializing)]
#[getset(get_copy = "pub", set = "pub")]
last_focused_workspace: Option<usize>,
#[serde(skip_serializing)]
#[getset(get_mut = "pub")]
workspace_names: HashMap<usize, String>,
}
@@ -54,6 +57,7 @@ pub fn new(id: isize, size: Rect, work_area_size: Rect, name: String) -> Monitor
work_area_size,
work_area_offset: None,
workspaces,
last_focused_workspace: None,
workspace_names: HashMap::default(),
}
}