Bug 26304 - setxkbmap: unable to use user configuration files
Summary: setxkbmap: unable to use user configuration files
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/XKB (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Daniel Stone
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-28 11:32 UTC by Daniel Dehennin
Modified: 2014-07-30 11:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Dehennin 2010-01-28 11:32:14 UTC
I have a problem with setxkbmap.

I want to use my own configuration in .xkb/ but it does not work. A debian bug report seems to explain the problem: -I does not append directory to the list.

====
setxkbmap -I/home/dad/.xkb -geometry "typematrix(tm2030USB)" -symbols "pc+fr(bepo)+inet(evdev)+ctrl(nocaps)+compose(menu)+terminate(ctrl_alt_bksp)+test(i243_mod3)" -v 10
Setting verbose level to 10
locale is C
Warning! Multiple definitions of symbols
         Using command line, ignoring rules file
Warning! Multiple definitions of geometry
         Using command line, ignoring rules file
Applied rules from evdev:
model:      pc105
layout:     fr
variant:    oss
options:    compose:menu,terminate:ctrl_alt_bksp,ctrl:nocaps
Trying to build keymap using the following components:
keycodes:   evdev+aliases(azerty)
types:      complete
compat:     complete
symbols:    pc+fr(bepo)+inet(evdev)+ctrl(nocaps)+compose(menu)+terminate(ctrl_alt_bksp)+test(i243_mod3)
geometry:   typematrix(tm2030USB)
Error loading new keyboard description
====
Comment 1 Daniel Dehennin 2010-01-31 09:14:32 UTC
First, this is not relevant to the debian bug report #524512, so I remove it from the URL and change the summary.

I try to track the problem and trace it to:
http://cgit.freedesktop.org/xorg/app/setxkbmap/tree/setxkbmap.c#n1001

The problem seems to be the XkbGetKeyboardByName call in applyComponentNames.
Comment 2 Petr Machata 2010-11-15 08:22:43 UTC
FWIW, I just hit this problem, too.  I'm solving a problem similar to that of this guy:
http://www.spinics.net/lists/xorg/msg33904.html
making it possible to use custom-defined symbols in "-symbols" invocation would be appreciated.
Comment 3 Daniel Stone 2010-11-15 08:34:38 UTC
Does the following:
setxkbmap -I/home/dad/.xkb -geometry "typematrix(tm2030USB)" -symbols
"pc+fr(bepo)+inet(evdev)+ctrl(nocaps)+compose(menu)+terminate(ctrl_alt_bksp)+test(i243_mod3)" -print | xkbcomp -I/home/dad/.xkb - :0

work?
Comment 4 Daniel Dehennin 2010-11-15 08:51:39 UTC
(In reply to comment #3)
> Does the following:
> setxkbmap -I/home/dad/.xkb -geometry "typematrix(tm2030USB)" -symbols
> "pc+fr(bepo)+inet(evdev)+ctrl(nocaps)+compose(menu)+terminate(ctrl_alt_bksp)+test(i243_mod3)"
> -print | xkbcomp -I/home/dad/.xkb - :0
> 
> work?

Yes, it works.

For now I use:
xkbcomp -I$HOME/.config/xkb $HOME/.config/xkb/keymap/persotm $DISPLAY

But I wanted to use the -device of setxkbmap to apply the configuration only to my typematrix keyboard (not the builtin keyboard of my laptop).

Regards
Comment 5 Daniel Stone 2010-11-15 09:09:40 UTC
(In reply to comment #4)
> Yes, it works.
> 
> For now I use:
> xkbcomp -I$HOME/.config/xkb $HOME/.config/xkb/keymap/persotm $DISPLAY
> 
> But I wanted to use the -device of setxkbmap to apply the configuration only to
> my typematrix keyboard (not the builtin keyboard of my laptop).

Assuming a recent enough xkbcomp, this will work:
xkbcomp -I$HOME/.config/xkb -i 7 $HOME/.config/xkb/keymap/persotm $DISPLAY

(Replacing 7 with your numeric device ID; the space between the -i and device ID is significant, which I should fix.)
Comment 6 Daniel Dehennin 2010-11-15 09:26:18 UTC
(In reply to comment #5)

> Assuming a recent enough xkbcomp, this will work:
> xkbcomp -I$HOME/.config/xkb -i 7 $HOME/.config/xkb/keymap/persotm $DISPLAY
> 
> (Replacing 7 with your numeric device ID; the space between the -i and device
> ID is significant, which I should fix.)

Ok, I'll wait for debian sid to have the recent enought one, for now it's x11-xkb-utils 7.5+5, I don't find a way to have xkbcomp version.

Regards.
Comment 7 Antonio Ospite 2014-07-30 11:15:33 UTC
Hi,

I run into this issue with "setxkbmap -I$HOME/.xkb/" trying to use a custom symbols file from "$HOME/.xkb/symbols/", and by looking at the code I think I got what is going on, please correct me if I am wrong.

As I wrote in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586371 setxkbmap applies the include path passed with the "-I" option only to rules and layout files, not to symbols and other components, this is because it tries to load these latter by name using XkbGetKeyboardByName(), not by file paths.

The man page states that:

       -I directory
               Adds a directory to the list of directories to be used to
               search for specified layout or rules files.

and I was overlooking that it meant _only_ layout and rules files.

So even if this is a suboptimal behavior, setxkbmap is behaving as
documented.

xkbcomp is way more powerful, so I'll use that to load custom keymaps with custom symbols; the advantage of setxkbmap in my case would have been that I could have put its parameters in $HOME/.Xkbmap and let gdm invoke it, but it's not the end of the world.

BTW, I think this should be marked as CLOSED/WONTFIX rather than RESOLVED/FIXED, the original reporter found an _alternative_ solution using xkbcomp but the original one with setxkbmap has not been solved.

Ciao,
   Antonio


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.