gentakojima / emojione-picker-ubuntu

Emoji picker for Ubuntu based on icons by Emojione
239 stars 14 forks source link

Adding middle-button click which triggers search #25

Open scar45 opened 7 years ago

scar45 commented 7 years ago

Hello! Thanks for this neat tool. I wanted to add a quick optimization in order to access the search window much faster, so I figured out how to wire up a function to the indicator on a middle-button mouse click. I am a Python super noob, but this PR is literally one line (OK, two with the comment...OK, actually more, since Git or my IDE trimmed some whitespace/tabbing), so hoping you might be keen to merge it in.

In doing this, I was originally attempting to add an argument to the script so that the search window would quickly open under the cursor by running something like ~/.local/bin/emojione-picker --search or even just ~/.local/bin/emojione-picker -s. This would spawn a 'lean' process that just displays the search window under the cursor position, focuses the input, does its thing w/user input, shows the notification, then terminates itself. It would still read from the recents so that you see them appear as well.

This way, I can launch that search window wherever I am via any means of execution (keyboard shortcuts/macro keys, launcher shortcuts, etc.). Maybe I should create an issue for a feature request? Anyway, thought you'd see it here. Thanks again for your work on this!