Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate workspaces with keybinds? #46

Open
cenunix opened this issue May 15, 2024 · 8 comments
Open

Navigate workspaces with keybinds? #46

cenunix opened this issue May 15, 2024 · 8 comments

Comments

@cenunix
Copy link

cenunix commented May 15, 2024

Is there any way to navigate through workspaces in the overview with keybinds instead of using the mouse? the mouse controls are nice when my hand is already there, without it already there though I find myself wishing I could scroll back and forth through the previews with a simple keybind.

@kooskaspers
Copy link

@cenunix, yes, you can do this with the default bindings of Hyprland:

bind=modifierkey,whateverkey,workspace,m-1
bind=modifierkey,whateverkey,workspace,r+1

In my case I have mapped the bracket keys to switch workspaces:

bind=,bracketleft,workspace,m-1
bind=,bracketright,workspace,r+1

These will work within the overview plugin as well.

@kiecla
Copy link

kiecla commented May 16, 2024

It might be nice if a single hotkey comination could respond to the overview visibility state
For example, one press of Super-TAB brings up the overview on the current workspace, the next cycles to the next workspace
I think hycov has something like that, with the hotkey that responds to plugin state

@KZDKM
Copy link
Owner

KZDKM commented May 18, 2024

Is there any way to navigate through workspaces in the overview with keybinds instead of using the mouse?

Opening overview does not disable any keybinds in your config, just configure hyprland keybinds to switch workspace.

It might be nice if a single hotkey comination could respond to the overview visibility state

Yeah that is possible but I could not think of a non-janky way of implementing it atm.

@kiecla
Copy link

kiecla commented May 24, 2024

Yeah that is possible but I could not think of a non-janky way of implementing it atm.

I was thinking of a separate dispatcher (perhaps overview:openOrNext) that does something like this pseudo-code

openOrNext() {
    if (isOverviewOpenOn(activeMonitor)) {
        goToNextWorkspaceOn(activeMonitor);
    } else {
        openOverviewOn(activeMonitor);
    }
}

No idea if that's how a plugin function is structured but you get the idea, doesn't seem too janky
Are any of those three functions used there needing to be created or would it be possible to patch this together from stuff you've already written for the plugin or that exists in Hyprland? The only one that seems it might not already be here is isOverviewOpenOn

@KZDKM
Copy link
Owner

KZDKM commented Jun 17, 2024

The proper way to implement this would be to create a keybind that executes a script that executes different dispatchers based on the overview state. Currently hyprland does not implement any API that allows plugin to interact with external scripts/programs. I might be able to create a socket so that scripts could implement an isOverviewOpen function.

@kiecla
Copy link

kiecla commented Jun 17, 2024

You're right, that would be the more modular solution to this

@bashfulrobot
Copy link

Just to add to this - is there a way to get:

bind=,bracketleft,workspace,m-1
bind=,bracketright,workspace,r+1

to actually move to the next with each subsequent tab press after bringing it up with alt tab? And on release of both goes to the workspace?

Almost like alt tab at that point.

Thank you.

Thank you.

@kiecla
Copy link

kiecla commented Jul 23, 2024

Just to add to this - is there a way to get:

bind=,bracketleft,workspace,m-1
bind=,bracketright,workspace,r+1

to actually move to the next with each subsequent tab press after bringing it up with alt tab? And on release of both goes to the workspace?

Almost like alt tab at that point.

Thank you.

Thank you.

That's discussed above
As a hacky workaround, you could probably configure hyprland so that Alt-TAB opens the overview ands enters a submap with only two entries, one where TAB cycles to the next workspace, and one where releasing alt with bindr exits that submap
That won't work very well if you use the three fingers up gesture to open the overview, but if you only use alt-TAB I think it would be acceptable until there is a socket as discussed above
Alternatively, if you use the gesture, you can switch on changing workspaces with gestures too in hyprland.conf and swipe up and down for overview:toggle and left and right for changing workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants