diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-10-06 05:43:09 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-10-06 05:43:09 +0000 |
commit | 3186ee4ec4542bdce121379b030f0e2fc91df94a (patch) | |
tree | 47b46ec9f0f019a7700a126a1782e2cd933e7e9b /app/setxkbmap/setxkbmap.c | |
parent | 23b128ba349994a84e3f457790cd8f4d2b72bb54 (diff) |
Update to setxkbmap 1.2.0
Diffstat (limited to 'app/setxkbmap/setxkbmap.c')
-rw-r--r-- | app/setxkbmap/setxkbmap.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/setxkbmap/setxkbmap.c b/app/setxkbmap/setxkbmap.c index 71563446a..13875b081 100644 --- a/app/setxkbmap/setxkbmap.c +++ b/app/setxkbmap/setxkbmap.c @@ -48,7 +48,7 @@ #define DFLT_XKB_CONFIG_ROOT "/usr/share/X11/xkb" #endif #ifndef DFLT_XKB_RULES_FILE -#define DFLT_XKB_RULES_FILE __XKBDEFRULES__ +#define DFLT_XKB_RULES_FILE "xorg" #endif #ifndef DFLT_XKB_LAYOUT #define DFLT_XKB_LAYOUT "us" @@ -85,6 +85,7 @@ /***====================================================================***/ static Bool print = False; +static Bool query = False; static Bool synch = False; static int verbose = 5; @@ -240,6 +241,7 @@ usage(int argc, char **argv) MSG("-model <name> Specifies model used to choose component names\n"); MSG("-option <name> Adds an option used to choose component names\n"); MSG("-print Print a complete xkb_keymap description and exit\n"); + MSG("-query Print the current layout settings and exit\n"); MSG("-rules <name> Name of rules file to use\n"); MSG("-symbols <name> Specifies symbols component name\n"); MSG("-synch Synchronize request w/X server\n"); @@ -254,6 +256,8 @@ dumpNames(Bool wantRules, Bool wantCNames) { if (wantRules) { + if (svValue[RULES_NDX]) + MSG1("rules: %s\n", svValue[RULES_NDX]); if (svValue[MODEL_NDX]) MSG1("model: %s\n", svValue[MODEL_NDX]); if (svValue[LAYOUT_NDX]) @@ -430,6 +434,8 @@ parseArgs(int argc, char **argv) } else if (streq(argv[i], "-print")) print = True; + else if (streq(argv[i], "-query")) + query = True; else if (streq(argv[i], "-rules")) ok = setOptString(&i, argc, argv, RULES_NDX, FROM_CMD_LINE); else if (streq(argv[i], "-symbols")) @@ -547,7 +553,7 @@ getDisplay(int argc, char **argv) /***====================================================================***/ /** - * Retrieve xkb values from th the XKB_RULES_NAMES property and store their + * Retrieve xkb values from the XKB_RULES_NAMES property and store their * contents in svValues. * If the property cannot be read, the built-in defaults are used. * @@ -977,7 +983,7 @@ applyComponentNames(void) dumpNames(False, True); } /* Upload the new description to the server. */ - if (dpy && !print) + if (dpy && !print && !query) { XkbComponentNamesRec cmdNames; cmdNames.types = svValue[TYPES_NDX]; @@ -1008,6 +1014,10 @@ applyComponentNames(void) { printKeymap(); } + if (query) + { + dumpNames(True, False); + } return True; } |