A wrapper for ydotool that translates keyboard input from non-QWERTY layouts to QWERTY, allowing proper text input with AZERTY, QWERTZ, and other keyboard layouts.
ydotool is a Linux keyboard/mouse automation tool that internally uses QWERTY layout regardless of your system keyboard layout. This wrapper automatically translates input to QWERTY before passing it to ydotool.
Example (French AZERTY):
- Input:
ydotool type "Bonjour" - Without wrapper: Types
Vonjout - With wrapper: Types
Bonjour
| Layout | Description | Key differences |
|---|---|---|
fr |
French AZERTY | a/q, z/w, m swaps, accents |
de |
German QWERTZ | z/y swap, umlauts, sharp s |
be |
Belgian AZERTY | Similar to FR, different number row |
it |
Italian | QWERTY-based, accented vowels on special keys |
es |
Spanish | QWERTY-based, ñ, ç, ¡/¿, dead keys for accents |
us |
US QWERTY | Passthrough (no translation) |
git clone https://github.com/david-vct/ydotool-rebind.git
cd ydotool-rebind
sudo ./install.shRequirements: ydotool installed, Bash 4.0+, root access
The installer follows standard Linux filesystem conventions:
- main wrapper executable:
/usr/local/bin/ydotool - internal translator script:
/usr/local/lib/ydotool-rebind/ydotool-translate.sh
If an older version was previously installed in /usr/bin, the installer automatically migrates it to the new layout.
The layout is detected automatically by cascade:
YDOTOOL_LAYOUTenvironment variable/etc/ydotool-rebind/configfile (LAYOUT=fr)setxkbmapauto-detection (X11)localectlauto-detection (systemd)- Fallback:
fr
To change the default layout:
# Edit config file
sudo nano /etc/ydotool-rebind/config
# Set: LAYOUT=de
# Or use environment variable
YDOTOOL_LAYOUT=de ydotool type "Hallo Welt"After installation, use ydotool normally:
# Types correctly with your keyboard layout
ydotool type "Bonjour, ça va ?"
# File mode
ydotool type -f /path/to/file.txt
# Other commands work as usual
ydotool key Return
ydotool mousemove 100 100- Wrapper intercepts all
ydotoolcommands - For
typecommands: loads the keyboard layout mapping and translates text - Passes translated result to real
ydotool
- French accents: e, e, e, a, u, c (circumflex, diaeresis)
- German umlauts: a, o, u, ss
- Ligatures: ae, oe
- All layout-specific symbols and key positions
DEBUG=1 ydotool type "test"
# Log: /tmp/ydotool-translate-debug.logsudo ./uninstall.shThe uninstall script removes the current /usr/local installation and also restores the original /usr/bin/ydotool if it detects a legacy installation.
MIT License - see LICENSE