Handy Linux tools With Python

One handy tool I’ve mised since moving over to Ubuntu for my desktop workstation is Quicksilver’s ability to perform a quick DuckDuckGo search using hotkeys. I looked into a few Linux alternatives like Gnome-Do, which I used to swear by, and the newer Synapse, but neither seemed to fit quite right for me. However, since Python is so well supported in Gnome, it turns out to be trivial to write my own. Python’s gui scripting support is very good. To get started, I grabbed a basic skeleton from YoLinux that popped up a box for text entry. Using this as a base, I modified the code to remove the "Enter text:" label and center the box on each launch. Next, I made sure that the code only grabbed the input when the user hit the return key. Once I had what the user was searching for, I replace the spaces with plus signs, and constructed a URL for a DuckDuckGo query. Finally, I used Python’s "webbrowser" module to open the query in my default web browser, Firefox. Once everything was running fine executing the script from the command line, I went hunting for a way to map

Read more at OSTATIC

Comments are closed.