A native GNOME extension designed for Wayland that instantly corrects text typed in the wrong keyboard layout (EN ↔ UA).
- Native Wayland Support: Uses
Clutter.VirtualDeviceto emit keystrokes. Nouinputor root privileges required. - Clipboard Protection: Automatically saves and restores your previous clipboard content after reclacing the text.
- GUI Configuration: Easily bind a custom shortcut (default is
Alt+A) via the built-in preferences using an interactive key recorder. - Zero Dependencies: Built using pure GJS and GNOME APIs.
- GNOME Shell: 50
- Session: Wayland (X11 is supported but optimized for Wayland architecture).
- Clone the repository:
git clone https://github.com/git-hntr/layout-fixer.git
- Create the extension directory:
mkdir -p ~/.local/share/gnome-shell/extensions/layout-fixer@hntr - Copy the files:
cp -r layout-fixer/* ~/.local/share/gnome-shell/extensions/layout-fixer@hntr/
- Compile the GSettings schemas:
glib-compile-schemas ~/.local/share/gnome-shell/extensions/layout-fixer@hntr/schemas/ - Log out and log back in. (Crucial step for GNOME on Wayland to detect new local extensions).
- Enable the extension using the Extension Manager app or via terminal:
gnome-extensions enable layout-fixer@hntr
Due to Wayland's strict security model, applications cannot inject text into other windows directly. This extension runs with compositor privileges and performs the following micro-operations in less than half a second:
- Reads and backs up the current
St.Clipboardstate. - Emits a synthetic
Ctrl+Cevent viaClutter.VirtualDeviceto capture the selected text. - Analyzes the string and performs EN ↔ UA transliteration.
- Writes the corrected text to the clipboard and emits
Ctrl+V. - Restores the original clipboard content after a brief delay.
- Open Extension Manager.
- Click the gear icon (⚙️) next to Layout Fixer.
- Click "Record" and press your desired key combination. Changes apply instantly.
Developed by hntr