1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/sh set -e readonly IPC=/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock hyprctl devices | sed -En '/Keyboard at/ { :loop n /active keymap:/! b loop s/.*active keymap: //p q } ' socat -u UNIX-CONNECT:"$IPC" - | sed -En 's/^activelayout>>[^,]+,//p'