Found a solution:
setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}'
to find out the current layout. The following allows you to install it:
setxkbmap -layout us
setxkbmap -layout ru
and this switches it:
if [ `setxkbmap -print | grep xkb_symbols | awk '{print $4}' | awk -F"+" '{print $2}'` = us ] ;then echo "EN"; echo "changing to RU..."; setxkbmap ru ; else echo "RU"; echo "Changing to US..."; setxkbmap us ; fi
If you use gxneur, it cannot handle all of this, but the standard Kubuntu build indicator is working fine.
Adobe source
share