Я написал собственный скрипт перевода: https://github.com/funboxxx/QTranslate-Bash-Script
#!/usr/bin/env bash
if ! [[ -d "$QTranslate" && -x "$QTranslate" ]]
then
$(mkdir "QTranslate";)
fi
newline=false
text=$(xsel -o)
text2=""
while read line; do
size=${#line}
for (( i=0; i <= size-1; i++ ))
do
znak=${line:$i:1}
case "$znak" in
"[") continue ;;
"\"") continue ;;
" ") text2+=\%\2\0 ;;
"@") text2+=\%\4\0 ;;
"#") text2+=\%\2\3 ;;
"$") text2+=\%\2\4 ;;
"%") text2+=\%\2\5 ;;
"^") text2+=\%\5\E ;;
"&") text2+=\%\2\6 ;;
"+") text2+=\%\2\B ;;
"=") text2+=\%\3\D ;;
"}") text2+=\%\7\D ;;
"{") text2+=\%\7\B ;;
"]") text2+=\%\5\D ;;
";") text2+=\%\3\B ;;
":") text2+=\%\3\A ;;
"/") text2+=\%\2\F ;;
"\\") text2+=\%\5\C ;;
"|") text2+=\%\7\C ;;
"?") text2+=\%\3\F ;;
",") text2+=\%\2\C ;;
"<") text2+=\%\3\C ;;
">") text2+=\%\3\E ;;
*) text2+=$znak
esac
done
text2+="%0A"
done <<< "$text"
text3="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=pl&dt=t&q=$text2")"
size2=${#text3}
text4=""
boolvar=true
for (( i=4; i <= size2-1; i++ ))
do
str=${text3:$i:2};
if [ $str == "[\"" ]
then
i=$i+1;
boolvar=true;
continue
fi
if [ ${text3:$i:3} == "\",\"" ]
then
i=$i+2
boolvar=false
continue
fi
if [ $boolvar == true ]
then
if [ $str == "\n" ]
then
i=$i+1;
text4+=$'\n'
continue
fi
text4+=${text3:$i:1}
fi
done
printf "EN___________________\n%s\n\nPL___________________\n%s\n\n\n\n\n\n\n\n" "$text" "$text4" >> QTranslate/translation.txt
zenity --text-info --title="Translation" --filename=QTranslate/translation.txt
Я хочу:
отключить автоматическое минимальное окно zenity ; auto refresh zenity text-area, если файл был изменен без закрытия приложения (мне нужно то же самое положение окна, что и раньше); перейдите в конец текстовой области (я не хочу прокручивать вниз с помощью мыши)