diff options
Diffstat (limited to 'setxkbmap.c')
-rw-r--r-- | setxkbmap.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/setxkbmap.c b/setxkbmap.c index 721e2ee..32e55b2 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -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")) @@ -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; } |