dots/scripts/Documents/Scripts/keyboardlayout.sh
2024-04-29 19:05:39 +02:00

16 lines
412 B
Bash
Executable file

#! /bin/sh
CURRENT_LAYOUT=$(setxkbmap -query|awk -F : 'NR==3{print $2}'|sed 's/ //g')
if [ "$CURRENT_LAYOUT" = "us" ]; then
setxkbmap "cz(rus)"
elif [ "$CURRENT_LAYOUT" = "cz(rus)" ]; then
setxkbmap "fr(us)"
elif [ "$CURRENT_LAYOUT" = "fr(us)" ]; then
setxkbmap "fi(nodeadkeys)"
elif [ "$CURRENT_LAYOUT" = "fi(nodeadkeys)" ]; then
setxkbmap "cz"
elif [ "$CURRENT_LAYOUT" = "cz" ]; then
setxkbmap "us"
fi