Fix text typed with the wrong keyboard layout (Russian ЙЦУКЕН ↔ English QWERTY).
ыгвщ ыныеуьсед → sudo systemctl
ды → ls
| Mode | Hotkey | Needs X11? | Use case |
|---|---|---|---|
| Bash (default) | Alt+T or Alt+E in the shell | No | Current command line in bash — SSH, TTY, VM without graphics |
| Selection | System/terminal shortcut → layoutfix -selection |
Yes (or Wayland tools) | Any highlighted text in a graphical terminal or app |
Recommended for servers and terminals without X: install + bash integration (readline).
Optional: -selection only if you have xdotool/xclip or wtype/wl-clipboard.
| Mode | Required |
|---|---|
| Bash Alt+T / Alt+E | bash, built layoutfix binary, ~/.bashrc snippet |
-selection |
X11: xdotool, xclip — or Wayland: wtype, wl-clipboard |
Go 1.22+ — only to build from source.
git clone git@github.com:Kizerfifas/layoutfix.git
cd layoutfix
chmod +x install.sh
./install.sh
source ~/.bashrc # or open a new terminalInstalls:
~/.local/bin/layoutfix~/.config/layoutfix/layoutfix.bash— binds Alt+T and Alt+E via readline- adds
sourceto~/.bashrcif missing
System-wide (optional):
sudo install -m 755 layoutfix /usr/local/bin/- Type with wrong layout on the current line:
ыгвщ ыныеуьсед - Press Alt+T or Alt+E (on Russian keyboard Alt+е is usually the same as Alt+T)
- The line becomes:
sudo systemctl
Works in:
- local terminal (TTY),
- SSH,
screen/tmux(bash readline in the pane).
Does not need GNOME, KDE, or a global desktop shortcut.
Manual convert (pipe / CLI):
echo 'ыгвщ' | layoutfix -print
layoutfix -print -text 'руддщ'
layoutfix -print <<<"$READLINE_LINE" # same as the hotkey handlerNeeds a graphical stack (X11 or Wayland):
sudo apt install xdotool xclip # X11
# or: sudo apt install wtype wl-clipboard # Wayland- Select text in the terminal or editor.
- Run
layoutfix -selection(bind to a key in your terminal emulator orxbindkeyson X11).
Example xbindkeys (config/xbindkeys.rc):
xbindkeys -f /path/to/layoutfix/config/xbindkeys.rcCommand in that file must call layoutfix -selection, not plain layoutfix.
- Does not fix typos on the same layout (
ыныеуьмед≠systemctlif you pressed the wrong key, not the wrong layout). - Bash mode converts the whole current line, not an arbitrary mouse selection (use
-selectionfor that).
| Problem | Fix |
|---|---|
| Alt+T / Alt+E does nothing | source ~/.bashrc; use bash. In Cursor/VS Code try Ctrl+] or Ctrl+X then Ctrl+L. Add to settings.json: "terminal.integrated.sendKeybindingsToShell": true. |
Works in bash, not in sh |
Binding is readline-specific; start bash. |
command not found: layoutfix |
Ensure ~/.local/bin is in PATH. |
go test ./...
go build -ldflags="-s -w" -o layoutfix .No license is provided. Use at your own risk. Authors assume no liability for damage or data loss.
| Режим | Клавиши | Нужен X11? | Когда |
|---|---|---|---|
| Bash (по умолчанию) | Alt+T или Alt+E в shell | Нет | Текущая строка в bash — SSH, TTY, VM без графики |
| Выделение | Системная/терминальная команда → layoutfix -selection |
Да (или Wayland) | Выделенный текст в графическом терминале или приложении |
Для серверов и терминала без X: установка + интеграция с bash (readline).
Опционально: -selection, если установлены xdotool/xclip или wtype/wl-clipboard.
| Режим | Нужно |
|---|---|
| Bash Alt+T / Alt+E | bash, бинарник layoutfix, фрагмент в ~/.bashrc |
-selection |
X11: xdotool, xclip — или Wayland: wtype, wl-clipboard |
Go 1.22+ — только для сборки.
git clone git@github.com:Kizerfifas/layoutfix.git
cd layoutfix
chmod +x install.sh
./install.sh
source ~/.bashrc # или новый терминалСтавится:
~/.local/bin/layoutfix~/.config/layoutfix/layoutfix.bash— привязка Alt+T и Alt+E через readlinesourceв~/.bashrc, если ещё не было
В систему (опционально):
sudo install -m 755 layoutfix /usr/local/bin/- Наберите на текущей строке:
ыгвщ ыныеуьсед - Alt+T или Alt+E (на русской раскладке Alt+е обычно то же, что Alt+T)
- Строка станет:
sudo systemctl
Работает в локальном TTY, по SSH, в screen / tmux.
GNOME/KDE не нужны — это не «системная клавиша рабочего стола», а горячая клавиша bash (readline) внутри терминала.
Вручную из CLI:
echo 'ыгвщ' | layoutfix -print
layoutfix -print -text 'руддщ'Нужен графический стек (X11 или Wayland):
sudo apt install xdotool xclip- Выделите текст.
- Запустите
layoutfix -selection(привяжите в настройках эмулятора терминала или черезxbindkeysна X11).
В config/xbindkeys.rc должна быть команда layoutfix -selection.
- Не исправляет опечатки на той же раскладке.
- В bash меняется вся текущая строка, не произвольное выделение мышью (для выделения —
-selection).
| Симптом | Решение |
|---|---|
| Alt+T / Alt+E не работает | source ~/.bashrc; bash. В Cursor/VS Code попробуйте Ctrl+] или Ctrl+X, затем Ctrl+L. В settings.json: "terminal.integrated.sendKeybindingsToShell": true. |
Нет layoutfix |
Добавьте ~/.local/bin в PATH. |
go test ./...
go build -ldflags="-s -w" -o layoutfix .Лицензия не предоставляется. Использование на свой страх и риск. Авторы не несут ответственности за ущерб и пот 4C52 ерю данных.