Closed carrascomj closed 4 years ago
I'm impressed with how seamless this plugin is. Thanks for your contribution!
You mentioned lazy_static
having some problems, which I'm not surprised about. I think phf::map
could make things more optimal, but that increases dependency count by a lot. Then again this project already has ~300 dependencies when fully loaded anyway so I don't care either way.
I see you're still making some tweaks so I'll merge tomorrow morning. Minor changes I'd love (but can totally do myself):
Invalid search engine 'dd'. Valid options are: 'ddg', 'archwiki', and 'rust'
instead of the current invalid engine
Cool! I implemented your suggestions and it is ready from my side. Feel free to change whatever you want (maybe you prefer other names for the engines, I just picked whatever was easy to read).
Thanks for the edits. Looking forward to putting echo -e "crates\ngithub\nrust\nddg\nenglish\ndocs\narchwiki" | dmenu | dmenu --lookup
somewhere is my dotfiles :+1:
After a week of frequent use, I've addressed minor areas of improvement. Everything's documented in make plugins
and dmenu --help
, but here's an overview:
--list-engines
once_cell
to phf
%s
, similar to how most browsers workenglish
to dictionary
and added thesaurus
for completionThis now simplifies the lookup command in my previous comment to:
dmenu --lookup --list-engines | dmenu | dmenu --lookup
That's very convenient, I like it :+1:
Closes #35
Description
Allow for a promptSearch like in xmonad. Adds the lookup FLAG:
With the engine OPTION:
The usage accepts any of the following:
echo ddg | dmenu --lookup
will search the input from the prompt at duckduckgo.dmenu --engine=github --lookup
will search the input from the prompt at github.dmenu_run --engine=rust --lookup
will search the input from the input at rust std docs usingdmenu_run
.Implementation
A
HashMap
with once_cell is used for the mappings from the input to the engine.&'static str
.dmenu
and the plugin.