Open unhammer opened 7 years ago
This is not a trivial fix, as different modi have their own history and sorting. Currently it sorts on frequency (wth is frecency?) within each mode.
I agree it would be nice feature to have, but I don't see a solution that won't require major overhaul to implement this right (tm). (A hack might be to give modi its own history, but this also has it limitations/issues.).
This is not a trivial fix, as different modi have their own history and sorting. Currently it sorts on frequency (wth is frecency?) within each mode.
Frecency:
I agree it would be nice is this could be nicer, but I don't see a solution that won't require major overhaul to implement this right (tm). (A hack might be to give modi its own history, but this also has it limitations/issues.).
I wouldn't mind having a history specific to the combi modi – it'd be a lot better than having my most frequent command always in second place :)
Aah thanks. Kinda assumed it a typo. :smile: always good to learn something new.
Somethings:
- How to handle multiple calls to different combi combinations?
Yeah, that would be the downside to having one history for drun,run,window
and one for window,drun
. Do people do this kind of thing often enough that it's an issue?
- Personally I use it like this: -combi-modi window, drun,run If I type firefox I want to launch firefox, if i have firefox open, I want to switch to the open firefox. The current behaviour does this.
Aha, I rarely use window
so I didn't think of that. I can't think of a good solution apart from Yet Another switch -prioritize window
which would put all the window
entries first, then the merge of drun,run
.
OTOH, although it'd require more changes to the code, maybe the Right solution is to keep a history for drun, run, window (~/.cache/rofi.druncache, ~/.cache/rofi-3.runcache, …) but read them all into a merged list (keeping track of their modes in the struct), so one can e.g.
cmp(a, b) =
if (prioritized(a->mode) && !prioritized(b->mode)) return 1
else if (!prioritized(a->mode) && prioritized(b->mode)) return -1
else if(a->freq != b->freq) return a->freq - b->freq
else return strcmp(a->name, b->name)
Version
Version: 1.3.1
Configuration
https://gist.github.com/unhammer/a2484e704cdc05395d997ad7cd072490
Launch Command
rofi -modi combi -show combi -combi-modi "drun,run,ssh,window"
Steps to reproduce
myscript
a bunch of times to matchrun myscript
my
What behaviour you see
drun Mypaint
(all drun entries are shown before any run entries, regardless of usage)What behaviour you expect to see
run myscript
at the top since it's so frequent