You are not logged in.

#1 2012-11-02 20:22:55

rusma
Member
From: Ås, Norway
Registered: 2009-11-01
Posts: 110

Can't set keyboard layout in X

Hello!

Some days ago X stopped setting XkbLayout to "no" despite me having specified it in /etc/X11/xorg.conf.d/01-keyboard-layout.conf.
The layout is different when setting it with setxkbmap, e.g. special AltGR characters like ] is gone.

I use .conf files in /etc/X11/xorg.conf.d/ and synaptics touchpad apparently works.

rasmus@angrist ~ % cat /etc/X11/xorg.conf.d/01-keyboard-layout.conf
Section "InputClass"
        Identifier         "Keyboard Defaults"
        MatchIsKeyboard	   "yes"
        Option	           "XkbLayout" "no"
	Option             "XkbVariant" "nodeadkeys"
	Option             "XkbOptions" "compose:ralt, caps:escape, terminate:ctrl_alt_bksp"
EndSection
rasmus@angrist ~ % cat /etc/X11/xorg.conf.d/10-evdev.conf
#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
        Identifier "evdev pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
EndSection

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "Xkblayout" "no"
EndSection

Let me supply some output. The output of `setxkbmap -print -verbose 10' before running `setxkbmap no':

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...
Success.
Applied rules from evdev:
rules:      evdev
model:      evdev
layout:     us
options:    compose:ralt, caps:escape, terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us+inet(evdev)+capslock(escape)+compose(ralt)+terminate(ctrl_alt_bksp)
geometry:   pc(pc104)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)+capslock(escape)+compose(ralt)+terminate(ctrl_alt_bksp)"	};
	xkb_geometry  { include "pc(pc104)"	};
};

After running `setxkbmap no':

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...
Success.
Applied rules from evdev:
rules:      evdev
model:      evdev
layout:     no
options:    compose:ralt, caps:escape, terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+no+inet(evdev)+capslock(escape)+compose(ralt)+terminate(ctrl_alt_bksp)
geometry:   pc(pc104)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+no+inet(evdev)+capslock(escape)+compose(ralt)+terminate(ctrl_alt_bksp)"	};
	xkb_geometry  { include "pc(pc104)"	};
};

Offline

#2 2012-11-08 04:53:22

rusma
Member
From: Ås, Norway
Registered: 2009-11-01
Posts: 110

Re: Can't set keyboard layout in X

Hey!

I got some success with disabling iBus in .xinitrc:

#### iBUS eviroment variables
#export XIM="ibus"
#export GTK_IM_MODULE="ibus"
##export QT_IM_MODULE="xim"
#export QT_IM_MODULE="ibus"
#export XMODIFIERS="@im=ibus"
#ibus-daemon -d -x &

as well as having this config in /etc/X11/xorg.conf.d/01-keyboard-layout.conf:

Section "InputClass"
        Identifier         "Keyboard Defaults"
        MatchIsKeyboard	   "yes"
	Option             "XkbRules" "xorg"
	Option             "XkbModel" "pc105"
        Option	           "XkbLayout" "no"
	Option             "XkbVariant" "nodeadkeys"
#	Option             "XkbOptions" "compose:ralt, caps:escape, terminate:ctrl_alt_bksp"
EndSection

DIsabling iBus solved autoconfig of keyboard to "no", and the new config with the addition of XkbModel solved not being able to use AltGr. I recon there is some bug in iBus and the config for X has changed in some way. Also, writing ^ and ~ and other characters in URxvt works now, as it has not worked for a long time, probably some years. I always thought there had something to do with Awesome.

Offline

#3 2012-11-09 13:32:50

mipper
Member
Registered: 2011-09-14
Posts: 6

Re: Can't set keyboard layout in X

Was having the same issue.  Assuming you're using Gnome, you have to set the keyboard layout in Gnome; it ignores the settings in the xorg config files.  You can add the keyboard layout you want in the Keyboard applet in gnome and remove the default US one.  After doing the all's well for me.

Offline

#4 2012-11-10 00:35:02

rusma
Member
From: Ås, Norway
Registered: 2009-11-01
Posts: 110

Re: Can't set keyboard layout in X

mipper, I am glad to hear you solved this issue in a different way. I am using Awesome Window Manager, so correct settings in Xorg is absolutely crucial to me. It may be more complicated, but ...

It is nice to be able to scroll in tmux with [ again, and writing @ in mails smile

Offline

Board footer

Powered by FluxBB