This posting is in reponse to a request from user:idim in this thread here about AutoKey in Linux.
See also this thread on AutoKey.
AutoKey is a Linux equivalent of Windows' autohotkey (which I'm not personally familiar with), but it uses Python as a scripting language, making it extremely powerful and flexible.
There are two versions: AutoKey, which uses python 2 and autokey-py3, which uses Python 3. As I understand it, the former is no being developed or supported, the latter is still active.
I use AutoKey extensively for various usefully automatable tasks, but user:idim was particularly interested in using it for search.
I'll post here one of my basic search scripts, based as noted on code from the second of the above links. It does a Google search on the europa.eu domain (site:europa.eu). Note that I am (I think!) using the python 2 version:
import webbrowser base="http://www.google.com/search?q=" phrase=clipboard.get_selection() #Remove trailing or leading white space and find if there are multiple #words. phrase=phrase.strip() singleWord=False if phrase.find(' ')<0: singleWord=True #Generate search URL. if singleWord: search_url=base+phrase+"+site:europa.eu" if (not singleWord): phrase='+'.join(phrase.split()) search_url=base+phrase+"+site:europa.eu" webbrowser.open_new_tab(search_url)As you'll see, it's extremely simple and very easy to customise for other sites (as long as they support search terms embedded in the URL). I have scripts for searching Linguee, IATE, for ICD10 codes on who.int, thesaurus.com and LEO.
Many thanks for this post. Just tested the script and it works just fine on my AutoKey-py3.
It is a very nice platform-wide solution for quickly launching various web searches based on clipboard content.
I remember the page on AutoKey sample scripts, but had missed the Google groups page.