-
Notifications
You must be signed in to change notification settings - Fork 19
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
(FR) Implement Fuzzy search #54
Comments
Which command are you talking about? Can you give examples for what you mean? |
I meant to replace maybe the grep function with the python package mentioned above: As an example, this is a way of how this works with the commandline This means that if you're looking for example for an entry named "password_spotify_all_familly", you could only type "psspotifam" and even with some typo. |
I'm open to this idea, but it needs to be implemented through regular expressions as that's what's used under the hood for searching. Something like this would be ideal, but I don't think that XML regex supports lookaheds. An option might be to substitute spaces with '.*' so that |
Almost a year late but this is what end up doing. First a python script to get all entries and print them to stdout, then a sh script to unlock the db, then call the python script and pipe that to fzf, once selected, copies the password to the clipboard. A bit hacky but it works great. from passhole.passhole import open_database
kp = open_database()
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
for e in kp.entries:
print(f"{e.group}::{bcolors.OKCYAN+e.title+ bcolors.ENDC}::{e.username}::{e.password}::") ph eval 'print("db unlocked")'
python ~/.local/bin/keepass2fzf.py | fzf --ansi --height=20 --preview-window=down,1 --preview="echo {4}" --with-nth 1..3 -d "::" --bind 'enter:become(echo -n {4} | xsel -ib)'
|
Implementing Fuzzy search would (I believe) improve greatly the user experience. Once used in other cli tools, it's hard to go back.
Python package:
https://pypi.org/project/fuzzysearch/
I'm happy to look at trying to implement it and create a PR if interested
thanks for a great tool. Perfect with i3/dmenu
The text was updated successfully, but these errors were encountered: