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
Add support for Ilia #21
Conversation
Ilia is used by Regolith Linux (Ubuntu+i3/sway).
With the growing amount of picker tools supported out of the box it seems more practical to have them together in a simple list that can grow and through which we can always iterate instead of a cumbersome growing if-else chain. This commit moves the pick tool selection to be stored in a bash hash map instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jesse, sorry for being a little slow on the response.
I have taken the liberty of changing the code around a little;
with a look to possibly supporting even more picking tools in the future I moved the current selection into a hash map which we iterate through.
Can you double-check with the new code changes that everything works well?
If you think everything looks good I think we are ready to merge.
Thanks for the PR!
["wofi"]="wofi -p 🔍 -i --show dmenu" | ||
["rofi"]="rofi -p 🔍 -i -dmenu --kb-custom-1 "Alt+1" --kb-custom-2 "Alt+2"" | ||
["dmenu"]="dmenu -p 🔍 -i -l 20" | ||
["ilia"]="ilia -n -p textlist -l 🔍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the ilia documentation I gathered that we can display our little spy-glass with the -l
option but I have no way of testing this locally without access to ilia.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 is now displayed at the bottom, but I now think it's not quite what you would expect it to. Here are some options:
ilia -n -p textlist -l "Emoji 🔍"
ilia -n -p textlist -l "🔍 Emoji"
ilia -n -p textlist -l "Emoji" -i desktop-magnifier
(from the GTK theme)
ilia -n -p textlist -l "🔍 Emoji" -i ""
@kgilmer I might be missing something... is there a way to completely disable the icon (like with Help
) or use a character and not a GTK icon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I knew I misunderstood something with the label. If there is no option to completely disable the icon I think I am fine with either of the last two choices; perhaps the GTK-icon actually makes the most sense since we are now in GTK-world. Thanks for looking into it!
@@ -20,6 +20,14 @@ bm_private_mode=${BEMOJI_PRIVATE_MODE:-false} | |||
# Do not sort results | |||
bm_ignore_recent=${BEMOJI_IGNORE_RECENT:-false} | |||
|
|||
declare -A default_pickers=( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not entirely sure which way would be the best to sort pickers:
I thought about going from most well known (e.g. most GH stars) to least well known, but that seems counter-productive since most people will often want to use the most 'obscure' picker they have installed I would think?
However, going the reverse way also seems counter-intuitive.
I have left it as is for now and just appended ilia, let me know if you have a better idea or some input on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about passing a picker via flag? I think by default whatever order is fine, but as for which one to actually execute, it makes most sense to me to allow the user to pass that in, and an argument to the script seems cleanest, even over an ENV
var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right and we can probably actually combine both worlds by letting users choose a default picker or supply a custom one through the same interface. I'll open a new issue for that since it goes a bit beyond this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And just as a last note to myself: the order of initializing the hash map does not even matter in bash, it's always sorted based on hash in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like tessen does something similar, FIFO-ish.
The rewrite (welcome by me!) works locally, however the icon is a little wonky, but I addressed that in a comment above. |
Ilia is used by Regolith Linux (Ubuntu+i3/sway). Ilia has a slightly different presentation and prompt setup than other pickers, and it makes more sense to use the given GTK icon instead of the emoji character since that is what it seems to support. Nicely explained by @jc00ke here: #21 (comment) With the growing amount of picker tools supported out of the box it seems more practical to have them together in a simple list that can grow and through which we can always iterate instead of a cumbersome growing if-else chain. This commit also refactors the pick tool selection to be stored in a bash hash map instead.
Merged as 74af60c. I used your suggestion of GTK icon for the label. |
I'm happy to contribute any way that's helpful! Thanks for adding |
Ilia is a desktop executor for Regolith. Thanks for your consideration!