The first release of the WaySwitch application has been published, offering features for automatic correction of text entered in the wrong keyboard layout or while Caps Lock is on, as well as fixing common typos. The program is positioned as an alternative to Punto Switcher and works in Linux environments based on the Wayland protocol. It supports operation in GNOME, KDE Plasma, Sway, Hyprland, Xfce, MATE, Budgie, and LXQt. The project code is written in Python using AI tools and is open under the MIT license. The graphical interface is created using the GTK library, but widgets for KDE and a module for the Waybar panel are also available. Ready packages are compiled in deb and rpm formats.
Main Features:
- Automatic correction and layout switching after pressing the spacebar without using hotkeys and without manually switching the layout (for example, after typing "ghbdtn", it will replace it with "привет" and switch to the Russian layout).
- Auto-replace and layout switching based on the first four Latin letters if the input does not match any word in the dictionary.
- Manual correction of the last word by double-clicking the Shift key and a whole phrase by triple-clicking Shift.
- Correction of selected text, transliteration (Привет -> Privet), and numbers in words (1250 -> "one thousand two hundred fifty"). Works only in GNOME.
- Correction of typos such as two capital letters at the start of a word, letters 'ю' and 'б' instead of period and comma, concatenated writing of particles, and missed spaces.
- Maintaining a list of exceptions for words and programs (for example, prohibiting auto-correction in the terminal and IDE).
Input events are intercepted using evdev via /dev/input/event*. Upon detecting a spacebar press, the background process decodes the accumulated buffer presses in the current and alternative layouts according to the libxkbcommon tables. The decision to replace input is made based on the dictionary and the character trigram model. Correction is performed by simulating layout switching, pressing Backspace, and substituting the new input.

Additionally, it is worth noting the release of the Lay 1.0.123 application a few days ago, which implements similar functionality but supports both Wayland and X11.
Source: opennet.ru
