Wine configuration for QTranslate under Linux/MacOS
#!/bin/bash
#xsel
WINDOW="$(xdotool getactivewindow)"
#xdotool key --delay 0 --window "${WINDOW}" ctrl+c
#notify-send --icon=info "$(xsel --clipboard)"
cd ~/bin
xsel > temp
cat temp | xclip -sel clip
cd ~/qtranslate_32/drive_c/Program\ Files/AutoHotKey/
WINEPREFIX=~/qtranslate_32 wine AutoHotkeyU32.exe SendInputCtrlShiftQ.ahk
cd ~/bin
rm temp
#!/bin/bash
#xsel
WINDOW="$(xdotool getactivewindow)"
#xdotool key --delay 0 --window "${WINDOW}" ctrl+c
cd ~/bin
xsel > temp
#xsel --clipboard < temp
cat temp | xclip -sel clip
#notify-send --icon=info "$(xsel --clipboard)"
cd ~/qtranslate_32/drive_c/Program\ Files/AutoHotKey/
WINEPREFIX=~/qtranslate_32 wine AutoHotkeyU32.exe SendInputCtrlQ.ahk
cd ~/bin
rm temp
#!/bin/bash
#xsel
WINDOW="$(xdotool getactivewindow)"
#xdotool key --delay 0 --window "${WINDOW}" ctrl+c
#notify-send --icon=info "$(xsel --clipboard)"
cd ~/bin
xsel > temp
cat temp | xclip -sel clip
cd ~/qtranslate_32/drive_c/Program\ Files/AutoHotKey/
WINEPREFIX=~/qtranslate_32 wine AutoHotkeyU32.exe SendInputCtrlE.ahk
cd ~/bin
rm temp
#!/bin/bash
WINEPREFIX="${HOME}/qtranslate_32" wine ~/qtranslate_32/drive_c/Program\ Files/QTranslate/QTranslate.exe
#!/bin/bash
cd ~/
export WINEPREFIX="${PWD}/qtranslate_32"
export WINEARCH=win32
wineboot -u
winetricks sandbox
winetricks winxp
winetricks ie8 riched20
winetricks allfonts
cd qtranslate_32/drive_c
wget https://ftp.mozilla.org/pub/firefox/releases/10.0.1/win32/en-US/Firefox%20Setup%2010.0.1.exe
wine Firefox\ Setup\ 10.0.1.exe &
wget https://qtranslate1.appspot.com/QTranslate.6.3.1.exe
wine QTranslate.6.3.1.exe &
cd Program\ Files/
wget https://ahkscript.org/download/ahk.zip --no-check-certificate
mkdir AutoHotKey
unzip ahk.zip -d AutoHotKey
rm ahk.zip
#Set in QTranslate hotkeys (Options -> Hotkey tab):
#ctrl+q -> Translate clipboard in popup window
#ctrl+shift+q -> Dictionary from clipboard
#Set Mozilla Firefox at tab Advanced: default browser option
git clone https://gist.github.com/d89490272d6a1a5b2cb64b1e6a2d3bf7.git
cd d89490272d6a1a5b2cb64b1e6a2d3bf7/
mkdir ~/bin
chmod +x send_wine*
chmod +x qtranslate_wrapper.sh
rm ~/bin/send_wine*
rm ~/bin/qtranslate_wrapper.sh
cp qtranslate_wrapper.sh ~/bin
cp send_wine* ~/bin
rm ~/qtranslate_32/drive_c/Program\ Files/AutoHotKey/SendInput*
cp *.ahk ~/qtranslate_32/drive_c/Program\ Files/AutoHotKey/
cd ..
rm -Rf d89490272d6a1a5b2cb64b1e6a2d3bf7
#set system shortcuts to script files: ~/bin/SendInput*
;Clipboard:=%1%
SendInput ^+q
Return
;Clipboard:=%1%
SendInput ^q
Return
;Clipboard:=%1%
SendInput ^e
Return
This is tutorial how to run awesome application to context translation: QTranslate The authors write on the site that they don't plan to support QTranslate for other platforms than Microsoft Windows. I felt a lack similiar solution at Linux. So I've tried to run that application at Linux Ubuntu distribution. On the end that's works I really appreciate all the help which I received at winehq forum.
Below you have instructions how to run QTranslate on your own machine:
sudo apt-get install xclip xsel
#install newest winetricks:
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
sudo cp winetricks /usr/local/bin
git clone https://gist.github.com/d89490272d6a1a5b2cb64b1e6a2d3bf7.git
cd d89490272d6a1a5b2cb64b1e6a2d3bf7
chmod +x install_qtranslate.sh
./install_qtranslate.sh
QTranslate should appear at your tray (near the clock). If not run QTranslate from your
start menu. Then click right mouse on icon of QTranslate, then choose Options
menu item.
At Basics
tab choose Font name:
Calibri and Text size:
11. Because default font doesn't
support a lot of signs (i.e. some French accents, cyrillic letters etc.). Set here your
First language
. The go to next tab.
At Hotkeys
tab clear hotkeys Control+Q
and Control+Shift+Q
then apply changes. After that
asign new shortcuts Translate clipboard in popup window
to Control+Q
and Dictionary from clipboard
as Control+Shift+Q
.
At Advanced
tab set Default browser
as Mozilla Firefox
.
You have properly configured QTranslate now.
Using your GUI, find application responsible for your system global shortcuts. Run it, and append new custom shortcuts to the scripts (use shortcuts comfortable to you and remember to don't override system shortcuts, or change them before asign them to this scripts):
for translation selected text in popup
for see selected word in popup dictionary
for listening pronunciation of selected word - works well only in wine context
If you would like to autostart the QTranslate then point ~/bin/qtranslate_wrapper.sh
ay your GUI autostart.
cd ..
rm -R d89490272d6a1a5b2cb64b1e6a2d3bf7
Run WINEPREFIX=~/qtranslate_32 winecfg
. Then on Graphics
tab check Automatically capture the mouse in Full-screen windows
and set proper dpi for your monitor. At Staging
tab selest all chechboxes except: Enable Environmental Audio Extensions (EAX)
Voila! It should works for you now!
If you would like to contribute to that Gist please tell me about that in comment.
Run WINEPREFIX=~/qtranslate_32 winetricks
then choose Select the default wineprefix
and press OK. Make sure that
proper prefix is showned at title bar. You have to choose Delete ALL APPLICATIONS INSIDE THIS WINEPREFIX
press OK
and accept all dialogs.
In dictionary popup the IPA is not showing properly.