summaryrefslogtreecommitdiff
path: root/setxkbmap.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-10-08 16:52:11 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-10-08 17:14:46 -0700
commit36288deba168dd2ca94630ffeab69f85461e33f8 (patch)
treec1aadfef9a01a0512599b086cde6d2328ce784e4 /setxkbmap.c
parent41416fdee30424d78771511bea39eef95f718c2a (diff)
Add -query option to print current RLMVO settings
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'setxkbmap.c')
-rw-r--r--setxkbmap.c12
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;
}