hyprland-void-dots/hypr-configs/dotfiles/eww/scripts/kb-layout/get-active

6 lines
306 B
Bash
Executable file

#!/bin/bash
hyprctl devices | grep -A 3 "$DEVICE$" | grep "active keymap:" | tail -n 1 | awk '{print toupper(substr($3,1,2))}'
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^activelayout>>/ {print toupper(substr($3, 1, 2))}'