I am using Ubuntu 24 with the default desktop. Does anyone have any idea how I could accomplish the following:
When the user has some text selected (in any application) and they press Ctrl-C twice in quick succession (defined as, say, the mouse double click time), then the default browser is launched with a command line pointing at a search for that text.
I have this on Windows via a utility called SearchClip and I find it's super handy, but I don't know how to port that to Ubuntu - it uses a global keyboard hook and that's a really Windows-specific thing.
Not for general highlighted text but there is a Firefox Extension called Swift Selection Search which might be of interest.
Click on the FF ☰ menu
Add-ons and Themes
and enter the name of the extension in the search box after which select it and click onAdd to Firefox
and follow the on-screen instructions.You can also search the internet from Terminal using the Lynx text-based web browser using the following Apt command in a terminal
sudo apt install lynx
.This instructional article shows you how.
There is a further opportunity to search using
S-Search
explained in the same article at Method 2.You'll need
xbindkeys
andxclip
if they aren't installed already.Now just type
xbindkeys
and press enter. First run will create~/.xbindkeysrc
. Runnano ~/.xbindkeysrc
and add the following:Run
xbindkeys -p
to poll the changes in~/.xbindkeysrc
.Change
firefox
to your browser, if needed. I don't know about double tappingc
but this will work usingCtrl
,Super
(Windows key), andc
(or any keys of your choosing, really).Copy the text as usual with
Ctrl+C
, then pressCtrl+Super+C
and it should launch a google search with the text on the clipboard.