#!/bin/zsh -x CUR_US=$(setxkbmap -print | grep xkb_symbols | grep -o "+us+") CUR_RU=$(setxkbmap -print | grep xkb_symbols | grep -o "+ru+") if [[ $CUR_US == "" ]]; then setxkbmap us fi if [[ $CUR_RU == "" ]]; then setxkbmap ru fi setxkbmap -option xmodmap ~/.Xmodmap