#!/bin/sh set -e export OSEL_GUI_FLAGS='-r "echo \"%s\" | cut -f2 | xargs echo -n"' export OSEL_TERM_FLAGS='--with-nth=2..' if choice="` sed -En 's/\s*name\[Group1\]\s*=\s*"([^"]*)"\s*;\s*/\1/p' \ ~/.xkb/symbols/mango \ | sort \ | nl -v0 -nln \ | osel `" then hyprctl -j devices \ | jq -r '.keyboards[-1].name' \ | xargs -I{} hyprctl switchxkblayout {} ${choice% *} >/dev/null notify-send -a "${0##*/}" -u normal 'Keyboard Layout Changed' \ "The keyboard layout was changed to ‘${choice##* }’." fi