nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
5.04k stars 76 forks source link

Feature Request: Ability to rename and renumber workspaces #245

Open sangaline opened 3 months ago

sangaline commented 3 months ago

In i3, I find it extremely useful to be able to rename workspaces. It's helpful to add some human-readable metadata to the workspace numbers describing the focus of the workspace. In i3, commands like workspace number 1 will continue to work if a workspace is renamed with a :... suffix like 1:firefox, so the names can be changed on the fly without changing the config. It's also helpful to be able to reorganize the ordering of your workspaces. Another important use-case this enables is temporarily moving workspaces out of the top 10 (or however many you have with active bindings) when you know that you won't need them for a while. I'll often push inactive workspaces out into the 11-20 range and then swap them back in when I need them again days or weeks later.

Here's an example of how I configured this in i3 to allow for easily moving and renaming workspaces:

bindsym Mod4+Shift+i exec i3-input
bindsym Mod4+i exec i3-input -F 'rename workspace to "%s'$(i3-msg -t get_workspaces | jq '.[] | select(.focused==true).name' | sed 's/[0-9]\+\(.*\)/\1/g' | sed 's/"//g')'"' -P 'Renumber workspace to: '
nikitabobko commented 2 months ago

If the feature were introduced to AeroSpace, I'd make it more "explicit". I don't like the "colon implicity" in i3 design.

I'd introduce a new property for workspaces called "tag". The currently existing workspace "name" remains it's unique identifier, but "tag" is an optional arbitrary non-unique text shown after the "name" in the tray

The proposal:

aerospace rename-workspace <new-name>
aerospace rename-workspace --tag <new-tag> [--name <new-name>]
  1. The first command would only rename the name
  2. The second command would rename the tag (and optionaly name in one go)

If a workspace named <new-name> already exist, I'd swap the names


A convenience alias like this could be introduced: aerospace rename-workspace <new-name>:<new-tag>

Though I need to forbid colon character in workspace names then

nikitabobko commented 1 month ago

It's not easy to implement, because a lot of code relies on the fact that workspace name is unique immutable identifier