Skip to content

Instantly share code, notes, and snippets.

@dvapelnik
Created August 12, 2014 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvapelnik/b941d3825280242ddfa2 to your computer and use it in GitHub Desktop.
Save dvapelnik/b941d3825280242ddfa2 to your computer and use it in GitHub Desktop.
Using Google Translate service for translate selected text on Ubuntu Unity (tested) via notify-send
#!/usr/bin/env bash
notify-send "$(xsel -o)" "$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=$(xsel -o | sed "s/[\"'<>]//g")&sl=auto&tl=ru" | sed 's/\[\[\[\"//' | cut -d \" -f 1)" -i accessories-dictionary -t 2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment