newspaint

Documenting Problems That Were Difficult To Find The Answer To

Using a USA Keyboard for English and Russian in XFCE

I found it difficult to find the instructions I needed for this.

All I wanted was to use my USA standard keyboard with XFCE (I am running Xubuntu 12.04.1) and be able to switch between English (USA) and Russian keyboard layouts.

The following user-mode script, when run, will bind the right-hand-side Windows key to the keyboard switch (so pressing the right Windows key will swap from USA-to-Russian and Russian-to-USA):

setxkbmap \
  -option \
  -option "grp:rwin_toggle" \
  -layout "us,ru" \
  -model "pc105"

It is my understanding that the initial empty -option command-line switch clears all previous option settings. The -option "grp:rwin_toggle" specifies which button swaps the keyboard layouts. The -layout "us,ru" specifies which keyboards to toggle between (I suspect more than 2 are permitted). Finally the -model "pc105" is appropriate for many modern USA keyboards.

Listing Available Toggle Buttons

user@myhost$ grep xkb_symbols /usr/share/X11/xkb/symbols/group
xkb_symbols "menu_toggle" {
xkb_symbols "lwin_toggle" {
xkb_symbols "rwin_toggle" {
xkb_symbols "ctrls_toggle" {
xkb_symbols "alts_toggle" {
xkb_symbols "lshift_toggle" {
...

Я счастлив!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: