christopher-l / space-bar

GNOME Shell extension that shows workspaces buttons in top panel
178 stars 14 forks source link

Feature Request: Navigating the Workspace History #26

Open johannesCmayer opened 1 year ago

johannesCmayer commented 1 year ago

I often run into the issue that I go to the wrong workspace with the first keyboard shortcut. Let's say I want to go to workspace 3 from workspace 5. Then I might hit the shortcut for workspace 2, then realize my mistake, and consequently hit the shortcut for workspace 3.

Normally I don't keep track of what workspace I was on to begin with, in this case, workspace 5. Instead, I use the "go to the previous workspace" shortcut. However, in the case where I do a miss shortcut the first time, this doesn't work anymore. I think it would be cool if they go backward to the previous active workspaces, without this history being modified as long as I have not released the SUPER key.

I think this would be a strict improvement, as it would not really hinder any existing functionality. It of course could be a feature that is disabled by default. I of course can replicate this by writing a wmctrl script, but I think it would be nice if this comes directly with space-bar.

christopher-l commented 1 month ago

Hi @johannesCmayer!

Sorry for the very late response. Your issue kind of slipped through.

I experimented a bit with ways to monitor key-release events, but the only way I could find so far would grab all keyboard events, so the usual shortcuts would stop working.

I tried another method based on a simple timeout, so if one switches away from a workspace within a second, this workspace will not be considered for the previous-workspace shortcut. I uploaded the version here: https://github.com/christopher-l/space-bar/raw/refs/heads/feat/debounced-prev-ws/space-bar@luchrioh.shell-extension.zip. It can be installed with

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

Would you (or anyone interested) consider this useful?

johannesCmayer commented 1 month ago

I switched to exwm 🫡