rofi icon indicating copy to clipboard operation
rofi copied to clipboard

[REQUEST] New keybind to keep rofi open after selection

Open vedxyz opened this issue 3 years ago • 2 comments

Before opening a feature request

  • [X] I checked the next branch to see if the feature has already been implemented
  • [X] I searched existing reports to see if it is already requested.

What is the user problem or growth opportunity you want to see solved?

Launching multiple entries back to back is cumbersome. This feature would greatly speed up certain workflows where multiple selections are made regularly.

How do you know that this problem exists today? Why is this important?

I regularly need to launch multiple entries and it's slow to keep reopening the rofi window for each one. Keeping the workflow within rofi instead of using external scripts is preferable to me.

Who will benefit from it?

Anyone with a workflow that would benefit from selecting multiple entries in one rofi window.

Rofi version (rofi -v)

1.7.3

Configuration

N/A

Additional information

Relevant discussion:

  • #1594

My idea is to add a keybind (kb-accept-persist?) that would behave identically to the existing accept keybind but would keep rofi open instead of quitting on selection. This should hopefully be a simple and non-intrusive feature as no one should be getting affected so long as the keybind isn't used.

I'm inexperienced with the rofi codebase but I would be willing to work on this myself too. https://github.com/davatorium/rofi/blob/eff3b86c944c192c036ecebcec504f9f30d24fdf/source/view.c#L1455-L1469 At a quick glance, I found the code above where I think I would just need to add another trigger that doesn't set state->quit = true on selection. I would appreciate any other pointers to look out for, should I try implementing this.

Also, would this keybind need to be limited to certain modi's? Say, for the window modi, would not quitting rofi upon selection be a problem as rofi is supposed to give focus to another window? In that case, it might make sense to make this specific to modi's like run, drun, ssh, no?

vedxyz avatar Feb 14 '22 14:02 vedxyz

You can try writing a script as documented in the rofi-script manpage or using the rofi-blocks plugin, although it would require re-implementing the mode you are using.

erik-overdahl avatar May 23 '22 15:05 erik-overdahl

This should be implemented in the mode itself, see also the implementation of the 'close-on-delete' option in the window browser, the return value of the result function should be changed.

DaveDavenport avatar May 23 '22 16:05 DaveDavenport