Friday, April 24, 2015

Google search and translate selected text with shortcut



Install xclip

sudo apt-get install xclip

opensuse -here

Create a script like so:
#! /bin/sh
sh -c 'firefox "https://www.google.com/search?q=$(xclip -o)"'

Save it as google-search.sh

For translating:
#! /bin/sh
'sh -c 'firefox "http://translate.google.com.ar/#en/fr/$(xclip -o)"'

Adapt for custom languages, save as google-translate.sh

Add shortkey for `sh path_to_our_script`

No comments:

Post a Comment