-
Notifications
You must be signed in to change notification settings - Fork 621
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
[REQUEST] Keep selected item position after selection #1064
Comments
This can be done already.
this selects row 6. It returns the row index + entry when an item is selected.. then you pass row index +1 to |
The thing is, I would need something like this without using -dmenu. As I mentioned in initial comment, I don't use rofi with -dmenu, I use it with -modi, specifing script I want to run, and it stays open until I explicitly close it, so it's not possible to specify row index while rofi is running. That's the reason I suggested key-binding solution, which invokes "Enter action", leaving the current state as it is. As I alrady said, it's not of any crutial importance, so if you find it to be too much of a hassle to implement, feel free to leave it closed :) |
Aah sorry I missed that you are using script mode. (never seen it mentioned as 'default mode' as dmenu was there first :D)). I though you talked about 'stock dmenu ' mode. Can you please add the version you are using. this will help people place the issue in a few years. |
Sorry for the confusion, I should said script mode right from the start, my bad :D Ofc, sorry about that as well. I'm running the latest version, 1.5.4-1, I'll add that to initial comment. |
Is there any plan or already existing implementation for allowing users to keep the selected row active? This would be a nice feature. Right now I'm planning on moving the most recently selected item to the top to fix the problem. |
Added a 'keep-selection' flag in git. Example here: https://github.com/davatorium/rofi/blob/next/Examples/test_script_mode_color.sh |
Hey bud, these are great news, it works amazingly!! I already added it to my script implementation, I'm super happy with the result.. Also, thanks for provided example, I wasn't aware those customization/tweaks are possible, it's super cool!! :) Cheers!! :) |
Hey, I noticed one thing.. When I enable keep-selection as you described, it works perfectly regarding position, but it seems like it's also keeping my last search in the prompt.. That means when I select an item from a list which is supposed to generate a new content, it being filtered by remembered query and initial results are often empty until I delete the searched term.. Now, I'm not sure if this is how it's suppose to work (keeping position also means keeping last search query in the input), or simply a bug.. If it turns out to be a bug, and if it's something too time consuming for you, you don't have to bother as far as I'm concerned, I can live with this by removing query every time.. I was just wondering if I produced this misbehavior with some of my scripts, or it's by design :) Anyway, thank you once again for everything you did with Rofi in general, and especially regarding this specific issue!! |
does it make sense to keep the selection when the content changes? |
p.s. there is also a 'new-selection' option now, maybe that is better. I can add the clear-input if needed. |
well no, but in my music library script, I have directory structure (like /genre/band/album/songs) and the songs, which are at the end of the path.. Now the problem is that I want keep-selection to be enabled when I'm choosing songs, because if I have a lot of songs, without keeping position I'll have to start all the way from the beginning for every song (or any other file in general, in my other scripts), which is like factorial movement.. That why keeping position help a lot.. But I don't want to keep the position while traversing through directory structure, only in the files/songs, but the keep-selection option is always on.. Hope the given scenario makes sense, if not, let me know and I'll try to clarify it with a better example :) |
I am not sure I follow, if content changes, then the 'selection' may move (as it is position based) same if content stays the same but filter changes. |
changed it so it clears the input |
I don't think the position is the problem, I won't mind if the selected item is in the middle of the next list, I can move it to the beginning or simply start typing to match what I'm looking for.. The problem is that if there is the filter query remembered, it will ignore anything that doesn't match, which will often leave an empty list, if that makes more sense :) Let me try the latest update, and also new-position, and I'll let you know if it fixes my issues.. Also, thanks a lot for such immediate response, I really appreciate it! :) |
Hmm, I'm trying to build it, but I'm getting: No rule to make target 'themes/iggy.jpg', needed by 'all-am'. error, are you familiar with that, or maybe know how to fix it? |
build fine here in both autotools/ninja and that parts works on several CI. |
Ok, I managed to build it with ninja, sorry about that.. But the behavior seems unchanged.. The "new-selection" keeps the input clean but doesn't remember the position, and "keep-selection" does the opposite - keeps position and input as well this is what I print for every list: printf "\0keep-selection\x1ftrue\n" Do I need some specific syntax to keep the input clean as well? |
confused? keep-selection should clean the input. keep-selection+new-selection overrides the selection. |
Oh, sorry, the input cleaning works great now, and it still keeps the position.. Thank you once again for such a fast response, and for immediately implementing a fix.. And, ofc, sorry if I wasted your time more than necessary, again, really appreciate all your efforts! :) Thanks! |
Hey, sorry for bothering, one more thing.. So, since there is a calc function that can be used in rasi config files, is there any way I can use variables defined withing that config in calc function? I found a similar question, and it mentions environment variables, but I'm not sure how to use those either, so any information regarding this subject would be much appreciated :) |
please don't ask questions in the issue tracker on an unrelated issue. Its against the rules. (this topic is now locked). |
Hi!
First, I want to express my honest appreciation for this software, I use it as main "gui" way of interacion in workflow, as well as in my project called ORW..
So, I have kinda really specific use case..
Few of my scripts have selection feature, which allows user to select multiple items on which following operation will be performed.
I recently found out multi-select option with dmenu mode, but my scripts are already written to work with rofi's "default" mode, and some of them are few hundred lines long, so it would be quite time consuming to rewrite whole logic to adjust them for dmenu mode, and beside that, every time I select something using dmenu, rofi launces again, which looks like a "blink".
So, what I would like to have is key-binding to keep "selected-item" in its place after I press it (like shift+Enter does, but with default Enter effect - no need for selection logic, my scritps are already handling that), because current behaviour returns it to first item, which means user need to select next item from the beggining..
If this feature is too complex to implement, or you find its application to be very marginal, therefore not worth of your time and effort, I'll totally understand. It won't be a deal breaker by any means, but it will curtainlly make my use case a lot more convenient :)
To better illustrate situation, I provided screenshot:
Here is also demo of one of my scripts in action:
file_manager_demo
Thanks in advance! :)
Version: 1.5.4-1
The text was updated successfully, but these errors were encountered: