Skip to content

AlexanderSobolev1990/easy_switcher_cpp

Repository files navigation

easy_switcher_cpp

Linux-переключатель раскладки и исправитель ввода на C++14. / C++14 Linux keyboard layout switcher and input corrector.

Читает /dev/input/event*, правит буфер и выводит через /dev/uinput. / Reads /dev/input/event*, fixes the buffer, and outputs via /dev/uinput.

Сборка / Build

Нужны CMake 3.7+ и C++14-компилятор. / Requires CMake 3.7+ and a C++14 compiler.

cmake -S . -B build
cmake --build build

Бинарник создается в build/ и копируется в bin/. / The binary is built in build/ and copied to bin/.

Debian-пакет / Debian Package

cmake -S . -B build
cmake --build build --target deb

Пакет .deb появляется в deb/. / The .deb package appears in deb/.

Пакет ставит бинарник, systemd unit и включает сервис. / The package installs the binary, systemd unit, and enables the service.

При первой установке сервис не стартует: сначала настройте конфиг. / On first install, configure before starting.

Использование / Usage

Нужны root-права для доступа к input/uinput. / Root privileges are required for input/uinput access.

sudo ./bin/easy_switcher_cpp --configure
sudo ./bin/easy_switcher_cpp --run
sudo ./bin/easy_switcher_cpp --debug

Конфиг: /etc/easy_switcher_cpp/default.conf. / Config: /etc/easy_switcher_cpp/default.conf.

Первый запуск: / First run:

sudo easy_switcher_cpp --configure
sudo systemctl start easy_switcher_cpp

Опции / Options

-c, --configure   настроить / configure
-r, --run         запустить / run
-d, --debug       debug без содержимого клавиш / debug without key contents
    --trace-input debug с key events; может раскрыть секреты / debug with key events; may expose secrets
-o, --old-style   старый daemon-режим / old-style daemon mode
-h, --help        справка / help

Поведение / Behavior

Обычный replace-key исправляет последнее слово. / A normal replace-key press corrects the last word.

Shift+replace-key исправляет фразу при reverse-mode=false. / Shift+replace-key fixes the phrase when reverse-mode=false.

При reverse-mode=true эти действия меняются местами. / With reverse-mode=true, these actions are swapped.

Буфер чистится после Enter, навигации, модификаторов, клика, коррекции и 30 секунд простоя. / Buffer clears after Enter, navigation, modifiers, click, correction, and 30s idle.

Обычные логи не содержат key events. / Normal logs do not contain key events.

--trace-input только для короткой локальной диагностики. / --trace-input is only for short local troubleshooting.