#!/bin/bash

if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
  layout=$(hyprctl devices -j | jq -r '.keyboards[] | select(.main==true) | .active_keymap')
else
  layout=$(setxkbmap -query | grep layout | awk '{print $2}')
fi

case "$layout" in
  *English*) layout="EN" ;;
  *Russian*) layout="RU" ;;
esac

echo "$layout"
