christopher-l / space-bar

GNOME Shell extension that shows workspaces buttons in top panel
155 stars 12 forks source link

Make Smart Workspace Names More Dynamic #33

Open robinwersich opened 4 months ago

robinwersich commented 4 months ago

Issue

The workspace names currently don't always properly reflect their content:

  1. When closing all windows, the workspace name determined by the previously open window is still shown. I would prefer it if empty workspaces would return to numbered name or a customizable predetermined name (Main, Empty, ...). The second option would consequently also mean that any new, empty workspace would have that predetermined name. As I think these behaviors may not desired by everyone, they should of course be options that can be toggled ("reset empty workspace names" and "empty workspace name").
  2. If I first use a workspace for e.g. browsing, and then close the browser and open up e.g. an IDE, my workspace is still called Web because I first opened the browser on it.
  3. When moving a window to a new workspace, instead of opening it there, the workspace name is not updated

Proposed solution

I think the first two issues can be solved by simply triggering a re-evaluation of the smart workspace name whenever the window that previously determined the workspace name is closed. For the third issue, also some watching mechanism is probably needed to detect windows moved to the workspace.

christopher-l commented 3 months ago

Hi @robinwersich, thanks for sharing your thoughts!

I also think that the current behavior is not ideal in some situations. I thought about resetting the workspace name when the last window is closed, but I also like your idea of connecting the name to the window that determined it.

I don't know yet when of if I get around to implementing something like this, but I'll definitely keep the idea in mind.

christopher-l commented 2 months ago

Hi, I implemented a first version of a possible solution. To try it, download https://github.com/christopher-l/space-bar/raw/feat/update-smart-names/space-bar@luchrioh.shell-extension.zip and run the following command inside the download directory:

gnome-extensions install --force space-bar@luchrioh.shell-extension.zip

I didn't do a lot of testing yet, so it might be broken. The concept is to monitor windows on a workspace and when there is no window left to support the currently assigned name, the name is reset (and replaced with a name supported by the remaining windows).

christopher-l commented 2 months ago

I removed the branch and zip mentioned above in favor of an experimental option in the released version / the main branch.