#!/bin/zsh -x CUR_US=$(setxkbmap -print | grep xkb_symbols | grep -o "+us+") CUR_RU=$(setxkbmap -print | grep xkb_symbols | grep -o "+ru+") CUR_DE=$(setxkbmap -print | grep xkb_symbols | grep -o "+de+") # us > de > ru if [[ $CUR_US == "+us+" ]]; then setxkbmap de ratpoison -c "echo keyboard map DE" elif [[ $CUR_DE == "+de+" ]]; then setxkbmap ru ratpoison -c "echo keyboard map RU" elif [[ $CUR_RU == "+ru+" ]]; then setxkbmap us ratpoison -c "echo keyboard map US" fi setxkbmap -option xmodmap ~/.Xmodmap