I'd like to ask a question about xkb settings.

Consider the following scenario. I want two keyboard layouts and a way to easily switch between them. Let's consider US and US(dvorak).

To switch I want to use the xkb option grp:shifts_toggle which makes

ShiftR + ShiftL := ISO_Prev_Group
ShiftL + ShiftR := ISO_Next_Group

To get the desired behaviour I run the command
setxkbmap -layout us,"us(dvp)" -option grp:shifts_toggle
which correctly set the desired option (tested with setxkbmap -print).

The problem comes with the desktop environment. In particular under openbox everything works out of the box while under gnome the option gets set but does not work.

Anyway when I issue the command under gnome the keys gets correctly remapped i.e. the ISO_Next(Prev)_Group is triggered but do not take effect in the system (I tested it with xev).

I guess gnome uses some further utility which relies on xkb but overrides it somehow.

For completeness I give my xkb settings before any command is issued.

>> setxkbmap -print -verbose 10

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us,us
variant:    altgr-intl,
options:    terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(altgr-intl)+us:2+inet(evdev)+terminate(ctrl_alt_bksp)
geometry:   pc(pc105)
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(altgr intl)+us:2+inet(evdev)+terminate(ctrl_alt_bksp)"   };
    xkb_geometry  { include "pc(pc105)" };

EDIT: It seems that setting grp:shifts_toggle directly in the configuration file in xorg.cong.d makes the combination works at least for ISO_Next_Group. Nevertheless ISO_Prev_Group still is still not effective.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.