summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setxkbmap.c12
-rw-r--r--setxkbmap.man6
2 files changed, 16 insertions, 2 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;
}
diff --git a/setxkbmap.man b/setxkbmap.man
index f3f44b4..7f8405a 100644
--- a/setxkbmap.man
+++ b/setxkbmap.man
@@ -80,11 +80,15 @@ previously specified options, use the \fI-option\fP flag with an empty
argument first.
.TP 8
.B \-print
-With this option the \fBsetxkbmap\fP just prints component names in a format
+With this option \fBsetxkbmap\fP just prints component names in a format
acceptable by \fBxkbcomp\fP (an XKB keymap compiler) and exits. The option
can be used for tests instead of a verbose option and in cases when one needs
to run both the \fBsetxkbmap\fP and the \fBxkbcomp\fP in chain (see below).
.TP 8
+.B \-query
+With this option \fBsetxkbmap\fP just prints the current rules, model,
+layout, variant, and options, then exits.
+.TP 8
.B \-rules \fIfile\fP
Specifies the name of the rules file used to resolve the requested layout
and model to a set of component names.