#!/bin/bash [ "${1}" == "-u" ] && setxkbmap us && exit 0 [ "${1}" == "-r" ] && setxkbmap ru && exit 0 # Assume toggle cur="$(setxkbmap -query|grep layout:|awk '{print $2}')" [ "${cur}" == "ru" ] && setxkbmap us && exit 0 [ "${cur}" == "us" ] && setxkbmap ru && exit 0 # vim:ts=4:tw=80:sw=4:et:ai:si