switchkb (368B)
1 #!/usr/bin/zsh 2 3 if [ "$1" = "" ] ; then 4 #echo "which language, gb or us?" 5 #exit 0 6 lang="colemak" 7 else 8 lang=$1 9 fi 10 11 kill $(pidof xcape) 12 setxkbmap -option 13 if [[ "$lang" == "colemak" ]] ; then 14 setxkbmap -option ctrl:nocaps colemak-ctrl 15 xmodmap ~/.xmodmap 16 else 17 setxkbmap -option ctrl:nocaps $lang 18 fi 19 xcape -e 'Control_L=Escape' 20 21 echo "keyboard is switched to $lang"