-
Notifications
You must be signed in to change notification settings - Fork 613
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
Ability to *replace* the list in combi mode via a script #1934
Comments
Note: one workaround for this is to run a new instance of rofi instead of returning new items to the existing instance. However this makes the code of the script much more clunky (the first instance calls your script again, which needs to parse the argument, and then run rofi, running your script a third time with another more different argument), causes the window to blink closed for a moment (not a big deal, but still worth mentioning), and just overall feels like the wrong answer. |
I don't understand this request.. You want want to combine the lists of multiple modes, this is what combi mode does and what you indicate it does, but also not? It sounds more liike you do not want to use combi mode, but open multiple modes at the same time (under one keybinding), something rofi can do. |
Yes, when I call Rofi with my key bind, I want it to show multiple modes, but then when I use that list to call the option from one of my modes, I want what that mode returns to be the only thing listed. I guess I don't really understand the use case of combi mode with its current implementation when calling a mode/script that returns more options. Why would I call a mode to get more options, but then choose something else entirely? That would be like driving to the Pizza shop but then not buying a pizza and instead leaving, going to the laundry mat, and doing my laundry.
I don't know what you mean by open multiple modes at the same time. Can you point me towards documentation that explains this? I know what I'm trying to describe is a bit convoluted, so let me demonstrate the current behavior and the desired behavior: Current Behavior:Action: Start Rofi in combi mode Rofi Displays: Action: Type in Shut and select the option Shut Down Rofi Displays: Desired Behavior:Action: Start Rofi in combi mode Rofi Displays: Action: Type in Shut and select the option Shut Down Rofi Displays: |
I use it to combine window and drun.. so if I open rofi type in 'firefox' it either switches to open instance, otherwise launches it. This is what it was designed for.
It all depends on the use-case, there is more then just one. I also think that is not a very honest/good analogy. You are not going to the pizza shop and next to the laundromat.. You are going to the combined shop that sells both pizza as do your laundry (hence it is called combi (short for combined)). But given your explanation below I think I understand what you are trying to say.
Its the default setup, it is shown in the video/screenshots on the github page, etc. You can open 3 views:
and then use the appropriate keybindings (or mouse) to switch between them. then hit the key: (I've typed some in to hide some info as I did not feel like grabbing gimp to blur) Thanks for the explanation, that makes it a lot more clear how you (intend) to use it. This is indeed currently not possible.. When combi mode was written, script mode did not exists. Rofi is build in a way that modes are very standalone, combi mode has no idea what each mode does, it just proxies the information through. This could be fixed in a nice way, patch(es) are welcome. |
That makes sense.
My first inclination for how to implement this would be with a Mode Option. Similarly to how a mode option can be used to change the prompt, we could have a mode option that tells combi mode "clear everything else out of your list, only display what I'm giving you." |
I am not completely sure what you mean with 'Mode Option'.
I am not sure what Mode Options are.. but combi mode has a very limited interface to the combined modes that is proxies to it own mode interface. ( See f.e. here on how a mode looks https://davatorium.github.io/rofi/guides/Plugins/2017-04-19-rofi-140-sneak-preview-plugins/) |
https://github.com/davatorium/rofi/blob/1.7.3/doc/rofi-script.5.markdown#passing-mode-options |
aah, I was thinking more at the C level 'mode' structure and interface, that is why I linked some example mode. (I don't really use script mode myself ) Most of those are really limited to script mode/dmenu. I currently do not have time to add new features to rofi, I hope somebody is willing to pick this up and make a decent implementation for this. In the current implementation, combi has no knowledge about what type of mode it runs, and a mode has no knowledge if it is rofi calling it directly or proxied via combi mode. This abstraction is something I don't want to break. A solution to this problem should take this abstraction into account. |
Before opening a feature request
What is the user problem or growth opportunity you want to see solved?
Scripts that return new options (such as confirmation dialogs) do not replace the entire list of options in combi mode. They only replace their own options.
How do you know that this problem exists today? Why is this important?
I have tested and looked for a solution and can not find any.
Who will benefit from it?
Users who wish to have a lot of functionality in combi mode, which reduces the need to remember multiple keyboard shortcuts
Rofi version (rofi -v)
1.7.3
Configuration
https://gist.github.com/schaefsteven/3ebbe2a001ecebed7af23cdd36eeffe4
Additional information
If a script returns new options to rofi, rofi (in single-mode operation) replaces the current list of options with the new list.
In combi mode, the other modi's options remain in the list.
In my case, I have combi mode with drun and a Power Management script, which asks for confirmation before executing its commands, but the confirmation options appear at the end of the options list (off the screen), which is not the desired function.
The text was updated successfully, but these errors were encountered: