summaryrefslogtreecommitdiff
path: root/.config/eww/scripts/keymap-listener
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww/scripts/keymap-listener')
-rwxr-xr-x.config/eww/scripts/keymap-listener16
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/eww/scripts/keymap-listener b/.config/eww/scripts/keymap-listener
new file mode 100755
index 0000000..a9666aa
--- /dev/null
+++ b/.config/eww/scripts/keymap-listener
@@ -0,0 +1,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'