Created
September 30, 2013 22:08
-
-
Save DenimTornado/6771031 to your computer and use it in GitHub Desktop.
From http://habrahabr.ru/post/195900/#comment_6794244 Перевести выделенное с автоматически определённого языка в выбранный
Забиндить на хоткей как: «translate ru» или «translate en»
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source=$(xsel -o | sed "s/["'<>]//g") | |
trans="$(wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=${source}&sl=auto&tl=$1" | sed 's/[[["//' | cut -d " -f 1)" | |
url=`echo "$trans" | xclip -filter -selection clipboard` | |
notify-send -t 2500 "$source" "$trans" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment