Closed MahouShoujoMivutilde closed 1 year ago
done in 79adba557eccff5d19f300f3d04b1f3f67aee407
https://wiki.hyprland.org/Configuring/Using-hyprctl/
hyprctl setxkblayout [keyboard] [cmd]
where just like in sway cmd
is next prev or id
Thanks!
Hey, it's actually hyprctl switchxkblayout ...
❯ hyprctl switchxkblayout logitech-usb-keyboard next
ok
~
❯ hyprctl switchxkblayout logitech-usb-keyboard next
ok
~
❯ hyprctl --help
usage: hyprctl [(opt)flags] [command] [(opt)args]
commands:
monitors
workspaces
clients
activewindow
layers
devices
dispatch
keyword
version
kill
splash
hyprpaper
reload
setcursor
getoption
cursorpos
flags:
-j -> output in JSON
--batch -> execute a batch of commands, separated by ';'
~
❯ hyprctl --help | grep switch
~
❯ hyprctl version
Hyprland, built from branch main at commit 79adba557eccff5d19f300f3d04b1f3f67aee407dirty (added hyprctl switchxkblayout).
flags: (if any)
It works fine, but it's missing from hyprctl --help
.
fixed
In sway you can
From the man page:
https://man.archlinux.org/man/sway-input.5.en
Use case
Described here https://github.com/hyprwm/Hyprland/discussions/915, also would help with scripting https://github.com/hyprwm/Hyprland/issues/1162
Basically, switching layouts with
grp:
toggles is very fast, while redefining them viais quite a bit slower (like ~1ms? vs 40ms slower)
while
xkb_switch_layout
is like calling grp toggle from cli in terms of latency.