SETXKBMAP(1) NAME setxkbmap - set the keyboard using the X Keyboard Extension <...> OPTIONS <...> -I directory Adds a directory to the list of directories to be used to search for specified layout or rules files. Note the space between option (-I) and its argument (directory). This is misleading. setxkbcomp does not allow space between -I and directory: For example: $ setxkbmap -print -I . Couldn't find rules file (evdev) $ setxkbmap -print -I. xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+us+ru:2+inet(evdev)+group(shift_caps_toggle)" }; xkb_geometry { include "pc(pc105)" }; }; BTW, error message is also very confusing: "Couldn't find rules file (evdev)". Why setxkbmap couldn't find rules file? It is in usual place. I guess it interprets "." as layout name, but it is not clear why rules file not found. Does -I reset directory list to search files in? Man does not specify it. In any case, either man or the program should be fixed.
Created attachment 43213 [details] [review] Fix for the man page: space deleted.
Fix for the code to accept -I with or without the space: http://lists.x.org/archives/xorg-devel/2011-February/019120.html
(In reply to comment #2) > Fix for the code to accept -I with or without the space: Thanks, but I think -I option in setxkbmap should be aligned with -I option in xkbcomp. The latter does not allow space after -I. Would you fix xkbcomp as well?
(In reply to comment #2) > Fix for the code to accept -I with or without the space: > http://lists.x.org/archives/xorg-devel/2011-February/019120.html One more comment: If -I is the last argument in the command line, you issue an error: ERR("Error! Option \"-I\" requires an argument\n"); However, other options behave differently. Look at setOptString, they use VMSG1(0, "No %s specified on the command line\n", svName[which]); VMSG1(0, "Trailing %s option ignored\n", opt); Wouldn't it be better to behave consistently?
Fix adjusted as suggested in comment #4 has now been pushed to git master: http://cgit.freedesktop.org/xorg/app/setxkbmap/commit/?id=2011f509c56b73cc62105c689d702f279f522017
Hi guys, It is nice that setxkbmap now allows a space between -I and directory, but I insist you should fix the man, with my patch or independently, because: 1. -Idir without a space still allowed. 2. Help message (issued by -help option) still says "-I[<dir>]". 3. "xkbcomp -help" also states "-I[<dir>]". 4. It is a kind of long-term tradition. For example, look at "man gcc": it allows both forms but at the top it states "[-Idir...]" (with no space). BTW, I just noticed... "setxkbmap -help" message: -I[<dir>] Add <dir> to list of directories to be used What the square brackets mean? As I know from the source code, the directory is *not* optional now, so brackets should be removed.
(In reply to comment #6) > Hi guys, > > It is nice that setxkbmap now allows a space between -I and directory, but I > insist you should fix the man, with my patch or independently, I'll let you take care of submitting the patch you feel is appropriate, now that you've learned our review process.
Since these is a patch for this, can we please get it reviewed and pushed. Please email your patch to xorg-devel for review.
for completeness: commit 2011f509c56b73cc62105c689d702f279f522017 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Wed Feb 9 23:42:44 2011 -0800 Bug 34117: setxkbmap -I dir not accepted, despite man page
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.