setxkbmap -I /usr/local/share/X11/xkb broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
x11-xkb-utils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
x11-xkb-utils 7.7+1 (as supplied with Ubuntu 14.04 - Trusty)
setxkbmap -I /usr/local/
Instead, it appears to search first in the current directory, and then in /usr/share/X11/xkb
To reproduce, set up some file in /usr/local/
$ diff /usr/share/
247c247,248
< * $sun_custom $sun_var = pc+sun_vndr/%l%(v)
---
> ! * $sun_custom $sun_var = pc+sun_vndr/%l%(v)
> $sun gb mod3 = pc+gb(mod3)
332c333,334
< $sun $sun_custom = pc+sun_vndr/%l%(v)
---
> ! $sun $sun_custom = pc+sun_vndr/%l%(v)
> $sun gb pc+gb%(v)
Then
$ cd /usr/local/
$ setxkbmap -query -v 10 -model sun_type6_unix_usb -layout gb -variant mod3
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard model
Using command line, ignoring X server
Warning! Multiple definitions of keyboard layout
Using command line, ignoring X server
Warning! Multiple definitions of layout variant
Using command line, ignoring X server
Trying to load rules file ./rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: sun_type6_unix_usb
layout: gb
variant: mod3
Trying to build keymap using the following components:
keycodes: evdev+aliases(
types: complete
compat: complete
symbols: pc+gb(mod3)
geometry: sun(type6unix)
rules: evdev
model: sun_type6_unix_usb
layout: gb
variant: mod3
Observe the "symbols: pc+gb(mod3)
Now try the following from the home directory, which ought to have produced the same result:
$ cd
$ setxkbmap -I /usr/local/
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard model
Using command line, ignoring X server
Warning! Multiple definitions of keyboard layout
Using command line, ignoring X server
Warning! Multiple definitions of layout variant
Using command line, ignoring X server
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/
Success.
Applied rules from evdev:
rules: evdev
model: sun_type6_unix_usb
layout: gb
variant: mod3
Trying to build keymap using the following components:
keycodes: evdev+aliases(
types: complete
compat: complete
symbols: pc+sun_
geometry: sun(type6unix)
rules: evdev
model: sun_type6_unix_usb
layout: gb
variant: mod3
Evidently it was 'Trying to load rules file /usr/share/
Note that there is some disagreement between the manpage and the -help as to whether there should be a space after the '-I'. The bug arises with and without that space. So this is a subsidiary bug in the -help, which ought to be fixed.
Note also that it thinks that it is in the 'C' locale, whereas I actually use 'en_GB.UTF-8'. This is another subsidiary bug; I have verified using gdb that there is no relevant call of 'getenv'.
Note also that is -I <directory> of xkbcomp appears to work correctly.
Share and Enjoy!
I am not quite sure what rules.evdev.lst does, but it certainly gets read by setxkbmap. So to reproduce the bug you may need
$ diff /usr/share/ X11/xkb/ rules/evdev. lst /usr/local/ share/X11/ xkb/rules/ evdev.lst
659a660
> mod3 gb: Mod3 modifier
which I omitted to mention in my report above.