4

Switching Keyboard Layouts - the EASY way!

view full story
linux-howto

http://crunchbanglinux.org – I was frustrated at how I had to bind a different keybinding to each layout I wanted to switch to.  So I came up with a simple script which simply checks a file and changes the keyboard layout accordingly.  I needed to switch between US and US International, so those are the two layouts my script checks for.  However, this can easily be adapted for more than two layouts.Here's the script:#!/bin/bash KEYBOARD=`cat ~/.keyboard` test "$KEYBOARD" = "us" RETURN=$? if [[ $RETURN -eq 0 ]] then setxkbmap us intl echo "us intl" > ~/.keyboard exit fi (HowTos)