20

I want to have an option like Search on Google available in selected text's context menu in gnome-terminal. Something similar to the option which is available in selected text's context menu in google chrome / chromium / firefox browser:

search google

So, something similar like in the above image, but in gnome-terminal. Is this possible?

1

3 Answers 3

17

Yes, there is an option. First download the following deb packages:

Second, install them using the following commands in your terminal:

sudo dpkg -i /path/to/gnome-terminal-data_3.6.1-0ubuntu4.1_all.deb

sudo dpkg -i gnome-terminal_3.6.1-0ubuntu4.1_i386.deb
#or, depending on what you downloaded
sudo dpkg -i gnome-terminal_3.6.1-0ubuntu4.1_amd64.deb

And third, restart your terminal.

From now, when you will open your gnome-terminal you can quickly search on Google command line errors, warnings and other things. Highlight the text, right-click on it and choose "Search on Google". It opens the default web browser and go to the google search result page:

search on google from terminal

Source: Add Google Search to Gnome Terminal in Ubuntu 13.10

1
  • Does not work anymore on 14.04 !?
    – lrkwz
    May 24, 2016 at 14:10
10

Using Colinker, a customizable context menu for selected text, you can search selected text in any application not just the gnome terminal. On Linux systems, Colinker is designed to be used with xbindkeys and xclip.

1

Ubuntu 18.04

  1. Enable source code in "Software and Updates" Enable source code in "Software and Updates"

  2. Go to terminal

  3. Became a superuser

sudo -s
  1. Download and install developer packets to build gnome-terminal
apt-get build-dep gnome-terminal
  1. Download and build sources for current version of gnome-terminal
cd /usr/local/src
apt-get -b source gnome-terminal
  1. go to sources ( change the digits "3.28.2" in future versions )
cd gnome-terminal-3.28.2
  1. Download the patch
curl https://ypokhilko.linkpc.net/wp-content/uploads/2018/12/search_on_google.patch_.gz --output search_on_google.patch.gz
  1. Unzip and apply the patch
gzip -d search_on_google.patch.gz
cat search_on_google.patch | patch -p 1
  1. Configure
./configure
  1. Build solution again
make
  1. Store old version of the gnome-terminal-server
mv /usr/lib/gnome-terminal/gnome-terminal-server /usr/lib/gnome-terminal/gnome-terminal-server.old
  1. Copy new version instead of old
cp ./src/gnome-terminal-server /usr/lib/gnome-terminal/gnome-terminal-server
  1. Kill old instance of gnome-terminal-server (current instance of gnome-terminal will closed too)
killall gnome-terminal-server
  1. Run gnome-terminal and enjoy

Ubuntu 20.04.5 LTS

  1. Store old version of the gnome-terminal-server
mv /usr/libexec/gnome-terminal-server /usr/libexec/gnome-terminal-server.old
  1. Copy new version instead of old
cp ./src/gnome-terminal-server /usr/libexec/gnome-terminal-server
2
  • Welcome to Ask Ubuntu! :-) Thank you for posting a correct answer, but could you also edit end explain what you're doing so the user understand what they're doing and what the dangers are if gnome terminal gets upgraded in the future?
    – Fabby
    Dec 5, 2018 at 19:48
  • Yes, please let us know where this search on google plugin comes from, source code link would be great.
    – intijk
    Sep 18, 2019 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .