ch11ng / exwm

Emacs X Window Manager
2.86k stars 137 forks source link

Is it possible to name workspaces on-the-fly? #916

Open MountainMan1312 opened 11 months ago

MountainMan1312 commented 11 months ago

Howdy!

I found this relevant issue on how to setup named workspaces: #716

I'm wondering if there's a way to name additional workspaces upon creating them, instead of a pre-defined list?

Expected behavior

Upon running exwm-workspace-switch and pressing + to add an additional workspace, I should be prompted to enter a name and press RET to create a named workspace.

It would also be okay if I had to create the workspace first, then rename it.

Thanks in advance!

Stebalien commented 11 months ago

You could add a hook to exwm-workspace-list-change-hook that prompts you for a name and adds it to a list.

Personally, for multiple-workspaces, I recommend using the builtin tab-bar package instead of the EXWM workspace feature. You get almost the same functionality (and you get a tab bar!) while using a native feature with better integration. The only thing you can't get is the ability to move workspaces between monitors.

You'll still need to use at least one workspace per monitor, but I usually just assign those statically and never name/change them.

medranocalvo commented 10 months ago

@MountainMan1312, there is currently no way to name the workspaces via exwm-workspace-switch. I don't use that command myself, but the usual C-x 5 bindings plus the following additions:

(keymap-set ctl-x-5-map "n" 'set-frame-name)
(keymap-set ctl-x-5-map "5" 'select-frame-by-name)

Adding a binding to the exwm-workspace-switch prompt for setting the workspace name could be done. In my opinion this should be invoked by the user after having added the workspace, instead of directly. What could be a good binding? Are there other similar commands we could use for inspiration (e.g. r for tab-rename and rename-buffer)?

@Stebalien, that's very interesting. Are there issues you find when using EXWM that way? For example, when I quickly tested tab-bar I found that floating windows remained no matter which tab was selected (which might be desirable, but differs with respect to EXWM workspaces).

Stebalien commented 10 months ago

Are there issues you find when using EXWM that way? For example, when I quickly tested tab-bar I found that floating windows remained no matter which tab was selected (which might be desirable, but differs with respect to EXWM workspaces).

I never use floating windows, except as transient popups where I actually want them to be sticky. But I can see that being an issue.

medranocalvo commented 9 months ago

@Stebalien, thank you for the input, we might want to support both behaviours.

@MountainMan1312, any thoughts about https://github.com/ch11ng/exwm/issues/916#issuecomment-1715540650?