keyboard switch

Sergey Manucharyan serge at bonbon.net
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:
> 
> http://xfce.lindesign.se/db/viewtopic.php?t=396

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:
---------------------------
#!/bin/bash
if [ "$1" = "1" ]; then
setxkbmap us &> /dev/null
elif [ "$1" = "0" ]; then
setxkbmap "ru,am" "" "grp:alt_shift_toggle"
else
if setxkbmap -print | grep us &> /dev/null; then
echo "1"
else
echo "0"
fi
fi
----------------------------
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.

Sergey




More information about the Xfce mailing list