glazewm icon indicating copy to clipboard operation
glazewm copied to clipboard

Switch to previous workspace

Open gtsherman opened this issue 1 year ago • 1 comments

Just wondering if there's a way to bind a key to switch to the previously focused workspace? I didn't see this in the list of commands but wanted to make sure I'm not missing anything.

Loving GlazeWM so far. Thank you!

gtsherman avatar Oct 21 '22 18:10 gtsherman

this is a very necessary feature for any WM. I am referencing the same feature in Workspacer WM. https://github.com/workspacer/workspacer/issues/337

azinsharaf avatar Oct 26 '22 17:10 azinsharaf

I think this would be a very helpful feature. I find this incredibly useful on i3wm / sway (workspace back_and_forth) especially in the auto-back-and-forth variant: When pressing the current workspace number it switches back to the last focused one.

s-v-o avatar Oct 31 '22 10:10 s-v-o

I can do this task as follows. In WorkspaceService, create a field to store the previous focused workspace name. Create a command (e.g. focus workspace undo, I don't know what name to use) which checks if the previous focused workspace is available (there may be no switching or after config reload the old workspace may not be available) and does a switch to the workspace by name.

@lars-berger it's ok?

kuznetsovvj avatar Oct 31 '22 14:10 kuznetsovvj

@kuznetsovvj Sure, that implementation sounds perfect 👍 The naming on the equivalent command in yabai sounds good, focus workspace recent - maybe go with that?

@s-v-o I think it'd be cool to add the auto-back-and-forth feature from i3 down the road, but that should be its own issue.

lars-berger avatar Oct 31 '22 15:10 lars-berger

@lars-berger Again, I did not include a new command in the default configuration - I do not know what key combination to use.

kuznetsovvj avatar Oct 31 '22 18:10 kuznetsovvj

feature is done @lars-berger maybe close this issue?

kuznetsovvj avatar Nov 12 '22 19:11 kuznetsovvj

This is now a part of the latest release! 🎉

lars-berger avatar Nov 14 '22 15:11 lars-berger