I’m working on a plugin to expose workspaces in the UI as tabs, and also generally make workspaces easier to manage. The way I’m using workspaces is really analogous to how I use tabs in other apps, so I thought I’d expose them in the UI in the same way. I have the basic functionality working (in kind of a hacky way, by manually reading the
workspaces.json file), but there a few things that I can’t find a way to do.
- As far as I can tell, the only way to save a workspace is to open the “Manage Workspaces” command, then retype the exact name of the workspace again to resave it. This is kinda error prone and kinda breaks the flow of moving from workspace to workspace. So, I’m hoping there’s an easier way to save the current state of the workspace. I tried
this.app.workspace.requestSaveLayout()but nothing happened. Is there something available that I’m overlooking?
- Is there a way to know which workspace is currently active?
- I’d also like to be able to keep the plugin UI up to date with any new workspaces that have been created. Is there a way to listen for workspaces being created?
I’m kinda new to plugin development, so I’m not sure if I’m overlooking something obvious or anything. Thanks in advance for any help that people can provide!