Page 1 of 1

2 Hotkeys (copy + show translation) on Linux

PostPosted: Mon Jun 02, 2014 11:57 am
by Dert
For me it was annoying that i was forced to press Ctrl + C + C on every word. Ideally it must be one key, or two keys at least. So i managed to do it with 2 keys (f.e. Ctrl + Z). Here is a small guide (u'll need Autokey-Gtk). This is the only way i found, because i wasn't able to get autokey to work with combination like Ctrl + C + C (tried much things).

1. In GoldenDict set the hotkey of pop-up translation to Ctrl + Z (it wll only translate copied to the buffer text)
2. Install AutoKey-Gtk, for example from terminal:
Code: Select all
$ sudo apt-get install autokey-gtk

3. In AutoKey:
a) File -> New -> Folder
b) In that folder: File -> New -> Script
c) Select this script, set the hotkey for it Ctrl + Z
d) In the script body
Code: Select all
keyboard.send_keys("<ctrl>+c")
time.sleep(0.000000000000000000000001)

e) Save the script and u'r done. Setup autokey for launch at login