Repository navigation
fix(hyprland): add keyboard layout switch command with multi-device sync - #14928
MahirIsHere wants to merge 1 commit into
Conversation
|
|
Useful companion for multi-layout setups, and the fcitx5 virtual-keyboard Please double-check default binding collisions ( |
d11944d to
7105743
Compare
|
Thanks @jandrusk! Good catch on the binding collisions.
|
7105743 to
7413476
Compare
7413476 to
2f72a07
Compare
2f72a07 to
fa59670
Compare
fa59670 to
4a50bfa
Compare
|
Thank you for this. What it does is now on
This was checked against |
Summary
When Fcitx5 is running (enabled by default in Omarchy for IME support), it creates a virtual keyboard device (
hl-virtual-keyboard-fcitx5), which claims themain: yesflag in Hyprland. As a result, standard layout switching commands likehyprctl switchxkblayout current nextsilently fail to cycle the physical keyboard.Furthermore, Omarchy previously shipped no dedicated CLI helper to cycle keyboard layouts from scripts or keybindings.
Changes
bin/omarchy-hyprland-keyboard-layout-switch: Mirrors the multi-device synchronization logic inKeyboardLayout.qml(cycleLayout()). It identifies the primary typed keyboard, determines its next layout index, and switches all devices sharing that seat layout list to the same index in lockstep. This prevents devices from drifting apart and reliably cycles physical keyboards regardless of virtual devices or active layouts. Supports an optional[device]argument for targeted switching.test/shell.d/keyboard-layout-test.sh: Adds automated test coverage covering single-layout no-ops, multi-device lockstep synchronization, caller device selection, unknown device handling, and fallback behavior.SUPER + gravefor scratchpad andSUPER + Kfor keybinding menus), this PR strictly provides the core CLI command, leaving keybinding customization to user configuration (~/.config/hypr/bindings.lua) or XKB toggle options.Testing
omarchy commands --check(passes, 518 commands)../test/clitest suite (all tests pass)../test/shell.d/keyboard-layout-test.sh(all 41 tests pass).