Luckily for you, tualatrix did a small hack on gnome-terminal and added support to search on Google upon right clicking a message.
You need to add a third-party PPA for it to work though. Run these commands in a terminal:
sudo add-apt-repository ppa:tualatrix/personal
sudo apt-get update
sudo apt-get install gnome-terminal
Once updated, close all terminal windows and reopen again. It will work as intended.
I will try to explain it...
the command sh -c 'firefox "https://www.google.com/search?q=$(xclip -o)"'
will open firefox in www.google.com searching the words you have selected with your mouse.
To use it , you should install "xclip"
- Go to the terminal and type
sudo apt-get install xclip
- Then you can create a script with the command, create a "new document" and named as "search-google.sh"
- Open the file with gedit and put these lines:
- Save the file in your home eg: /home/user/search-google.sh
- Then change the permissions to make the script executable in the terminal type:
chmod 764 /home/user/search-google.sh
- Then you can create a custom keyboard shortcut to execute the script.
- Go to System Settings > Keyboard > shortcuts > Custom Shorcuts
- Add a new item and fill the fields Name:
search-google
and Command:sh/home/user/google-search.sh
Then give a keyboard shorcut to the script...click in "Disabled" and press the keys to the shortcut. eg: Ctrl+Alt+G
So, if you are in a web page or any document and you select or (text highlighted) a word or phrase... then press the keys for the shortcut eg: Ctrl+Alt+G
and Firefox will open searching in google for the text you have highlighted o selected.
On the other hand I think the user55822 tried to say was the Artha
application works like this command.. the difference is by default if you have a text selected with Ctrl+Alt+W
Artha will serch for that text but "offline" (As far as I know.)
But you can use both, if you need to search in Artha select the text and press the
shorcut keys Ctrl+Alt+W
, but if you want to look in google "online" you can use the script with the shorcut Ctrl+Alt+G.
All the credit for the command is for user55822
Hope will be useful.
Edit: The above instructions on setting the shortcut are for Ubuntu (proper).
To set the shortcut for that script (or for any script like that) in Xubuntu, see the answers to this question. To set the shortcut in Lubuntu (which does not have a GUI for that purpose):
Paste in Terminal:
sudo gedit ~/.config/openbox/lubuntu-rc.xml
There are a lot of groups of lines that set the keybinds and look like so:
<keybind key="C-A-t">
<action name="Execute">
<command>x-terminal-emulator</command>
</action>
</keybind>
To add a keybind for the google search script, insert this at the end of one of those groups:
<keybind key="C-A-g">
<action name="Execute">
<command>sh ~/search-google.sh</command>
</action>
</keybind>
Best Answer
Where
browser
is the desired web browser.