dotfiles/.local/scripts/dmenu_kblayout

26 lines
593 B
Text
Raw Normal View History

2025-02-01 00:22:29 -05:00
#!/bin/sh
layouts="US CUSTOM
INTL
IPA
MATH
SPECIAL
BOXDRAW"
choice="$(printf %s "$layouts" | wofi -S dmenu -p "Set keyboard layout:" -k /dev/null)"
if [ "$?" -eq 0 ]; then
if [ "$choice" = "US CUSTOM" ]; then
swaymsg input '*' xkb_layout 'uscustom'
elif [ "$choice" = "INTL" ]; then
swaymsg input '*' xkb_layout 'us(intl)'
elif [ "$choice" = "IPA" ]; then
swaymsg input '*' xkb_layout 'ipa'
elif [ "$choice" = "MATH" ]; then
swaymsg input '*' xkb_layout 'math'
elif [ "$choice" = "SPECIAL" ]; then
swaymsg input '*' xkb_layout 'special'
fi
fi