rvaiya / warpd

A modal keyboard-driven virtual pointer
MIT License
2.9k stars 131 forks source link

feature request: screen selection hint mode improvement #209

Closed SethMilliken closed 1 year ago

SethMilliken commented 1 year ago

In a multiple display setup, using hint mode with warpd can be frustrating because many times the screen you want to operate upon is not the one currently active. So this requires escaping out of the hintmode you invoked on the wrong screen, invoking the screen_activation_key, selecting the correct screen hint, invoking the normal mode hint binding, and finally the hint mode hint. This might be improved with a new screen activation binding that automatically drops into hint mode after the screen is selected. Ideally, there would be similar bindings for entering hint2 and grid mode after screen selection as well.

Alternatively, maybe a binding to move the current hint, hint2, or grid to the next screen.

herrsimon commented 1 year ago

A simple solution to the problem would be to introduce a “follow focus” option (if this is not already the current behaviour), making warpd change the active screen on any focus change event to the screen containing the focused window. This should eradicate the need for an explicit screen switch in most cases.

In addition, one could still change the active screen explicitly through screen selection mode, or alternatively by using the window manager or some utility to change focus (if I remember correctly, i3 has dedicated actions for moving focus to another screen).

In the worst case, this of course still requires the additional activation key press after an explicit screen change.

If it is still decided to remove the need for explicit activation from warpd, I vouch to do it via an additional command line flag, so that one could do things like warpd --screen-select --hint or warpd --screen-select --oneshot --hint --click left.

SethMilliken commented 1 year ago

I can see how "active screen follows focus" might help in some cases (and would be worthwhile on its own), but I don't think that would be sufficient here. For some additional context, I work primarily on macOS and I am leaning on warpd to help address some of the deficiencies macOS has with respect to keyboard window management. Activating an arbitrary window visible on a non-active screen is one of the very use cases that prompted my opening this issue. If I could already do this efficiently with the keyboard, I would have less need for warpd to be better at it.

Having a --screen-select commandline mode looks like it could provide a decent workaround, too. And even better if it optionally accepted a screen number as an argument. That way I could create bindings in another utility (e.g. Hammerspoon) that first invoked the screen selection command to activate the desired screen and then emitted the warpd hint binding.

rvaiya commented 1 year ago

--screen should be available in the latest commit, so you can do something like warpd --screen --oneshot; warpd --click 1 --hint. This should allow you to select a window on any screen using 3 keystrokes. Does this solve your problem?

rvaiya commented 1 year ago

Closing due to inactivity.