keyboard switch

Sergey Manucharyan serge at
Thu Jan 22 05:23:00 CET 2004

> I'm using 2 state launcher for that, and here is the script I'm using
> for it:

Thanks! I've slightly modified this script for 3 layouts 
that I need (english, russian, armenian) - this is not a perfect solution,
but it works:
if [ "$1" = "1" ]; then
setxkbmap us &> /dev/null
elif [ "$1" = "0" ]; then
setxkbmap "ru,am" "" "grp:alt_shift_toggle"
if setxkbmap -print | grep us &> /dev/null; then
echo "1"
echo "0"
The first state is for english (us), the second - for russian or armenian (ru, am),
we can chose from ru & am with <Alt-Shift>. So, you can adjust the script for
your needs. The grep's argument is us, if you like to have the fisrt layout
toggling by <Alt-Shift>, you have to check real output of the "setxkbmap -print".
The empty quotes are mandatory, you can add keyboard variant between them.


More information about the Xfce mailing list