summaryrefslogtreecommitdiff
path: root/.config/eww/scripts/keymap-listener
blob: a9666aad961627b5184e8dd3780b916d65c53fb3 (plain) (blame)
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'