Skip to content
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

Item deduplication needed on output #19

Closed
remyrd opened this issue May 8, 2019 · 4 comments
Closed

Item deduplication needed on output #19

remyrd opened this issue May 8, 2019 · 4 comments

Comments

@remyrd
Copy link

remyrd commented May 8, 2019

Simply put: name is not a unique id in bitwarden, and shouldn't be used to retrieve items.
Eg. https://github.com/mattydebie/bitwarden-rofi/blob/master/bwmenu#L97
id should be used instead.
Problem is I'm not sure rofi can hide part of the input it's been given...

@Mange
Copy link
Contributor

Mange commented May 8, 2019

Problem is I'm not sure rofi can hide part of the input it's been given...

It can not. I've tried this before.

fzf can do it --nth and --with-nth options:

    -n, --nth=N[,..]      Comma-separated list of field index expressions
                          for limiting search scope. Each can be a non-zero
                          integer or a range expression ([BEGIN]..[END]).
    --with-nth=N[,..]     Transform the presentation of each line using
                          field index expressions

I wish rofi had something similar to this. :(

@remyrd
Copy link
Author

remyrd commented May 8, 2019

Just a thought, I believe there are other ways out of this...

  • I commented on another issue Custom item formatting and global search #12 (comment) and well, assuming the user can "visually" deduplicate the entries since there is more metadata on each item and some templating maps the format to the fields in ITEMS, one could use additional select() statements (functions?) in jq to return the one good entry. Still, the user can't expect to get a different entry when selecting the second identical option
  • Deduplication could be offloaded to another rofi instance, offering initially a list of entries uniquely identified by whatever string the user configures.

@Mange
Copy link
Contributor

Mange commented May 8, 2019

When I did Mange/rofi-lpass (LastPass in Rofi) I added the ID to each entry like this:

Some Site [<ID>]

Copy password [<ID>]
Copy username [<ID>]

Then I could extract the ID on each line.

We could also use the built-in support for Pango markup (with the -markup-rows option to Rofi) to make the ID markers really small so it doesn't stick out as much.

@mattydebie
Copy link
Owner

Maybe the most generic way to handle this is to indeed use a second rofi to finetune the selection.
When you use bwmenu for searching folders this actually already happens. This could be really easy to add imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants