BurntSushi / wingo

A fully-featured window manager written in Go.
Do What The F*ck You Want To Public License
1k stars 90 forks source link

Switch to new workspace when it is created #45

Closed netvl closed 11 years ago

netvl commented 11 years ago

It would be great if it was possible to automatically switch to new workspace upon its creation. Now I have first create a workspace and then manually switch to it, this is rather inconvenient. Maybe an additional option to AddWorkspace?

BurntSushi commented 11 years ago

Actually, this can be done with no modifications to existing commands. Unfortunately, it relies on a less-than-well-documented feature of the Gribble command system: some commands return values. In this case, we can exploit the fact that AddWorkspace returns the name of the workspace that was added. This name can then be used as an argument to any command that accepts a workspace.

So to get what you want:

Mod4-Shift-a := Workspace (AddWorkspace (Input "New workspace name:"))
netvl commented 11 years ago

Yes, this works just right as intended. Again, thank you very much!