1SETXKBMAP(1) General Commands Manual SETXKBMAP(1)
2
3
4
6 setxkbmap - set the keyboard using the X Keyboard Extension
7
9 setxkbmap [ args ] [ layout [ variant [ option ... ] ] ]
10
12 The setxkbmap command maps the keyboard to use the layout determined by
13 the options specified on the command line.
14
15 An XKB keymap is constructed from a number of components which are com‐
16 piled only as needed. The source for all of the components can be
17 found in /usr/share/X11/xkb.
18
20 -compat name
21 Specifies the name of the compatibility map component used to
22 construct a keyboard layout.
23
24 -config file
25 Specifies the name of an XKB configuration file which describes
26 the keyboard to be used.
27
28 -device device
29 Specifies the numeric device id of the input device to be up‐
30 dated with the new keyboard layout. If not specified, the core
31 keyboard device of the X server is updated.
32
33 -display display
34 Specifies the display to be updated with the new keyboard lay‐
35 out.
36
37 -geometry name
38 Specifies the name of the geometry component used to construct
39 a keyboard layout.
40
41 -help Prints a message describing the valid input to setxkbmap.
42
43 -I directory
44 Adds a directory to the list of directories to be used to
45 search for specified layout or rules files.
46
47 -keycodes name
48 Specifies the name of the keycodes component used to construct
49 a keyboard layout.
50
51 -keymap name
52 Specifies the name of the keymap description used to construct
53 a keyboard layout.
54
55 -layout name
56 Specifies the name of the layout used to determine the compo‐
57 nents which make up the keyboard description. The -layout op‐
58 tion may only be used once. Multiple layouts can be specified
59 as a comma-separated list.
60
61 -model name
62 Specifies the name of the keyboard model used to determine the
63 components which make up the keyboard description. Only one
64 model may be specified on the command line.
65
66 -option name
67 Specifies the name of an option to determine the components
68 which make up the keyboard description; multiple options may
69 be specified, one per -option flag. Note that setxkbmap adds
70 options specified in the command line to the options that were
71 set before (as saved in root window properties). If you want to
72 replace all previously specified options, use the -option flag
73 with an empty argument first.
74
75 -print With this option setxkbmap just prints component names in a
76 format acceptable by xkbcomp (an XKB keymap compiler) and ex‐
77 its. The option can be used for tests instead of a verbose op‐
78 tion and in cases when one needs to run both the setxkbmap and
79 the xkbcomp in chain (see below).
80
81 -query With this option setxkbmap just prints the current rules,
82 model, layout, variant, and options, then exits.
83
84 -rules file
85 Specifies the name of the rules file used to resolve the re‐
86 quested layout and model to a set of component names.
87
88 -symbols name
89 Specifies the name of the symbols component used to construct a
90 keyboard layout.
91
92 -synch Force synchronization for X requests.
93
94 -types name
95 Specifies the name of the types component used to construct a
96 keyboard layout.
97
98 -variant name
99 Specifies which variant of the keyboard layout should be used
100 to determine the components which make up the keyboard descrip‐
101 tion. The -variant option may only be used once. Multiple vari‐
102 ants can be specified as a comma-separated list and will be
103 matched with the layouts specified with -layout.
104
105 -verbose|-v [level]
106 Specifies level of verbosity in output messages. Valid levels
107 range from 0 (least verbose) to 10 (most verbose). The default
108 verbosity level is 5. If no level is specified, each -v or
109 -verbose flag raises the level by 1.
110
111 -version
112 Prints the program's version number.
113
115 If you have an Xserver and a client shell running on different comput‐
116 ers and some XKB configuration files on those machines are different,
117 you can get problems specifying a keyboard map by model, layout, and
118 options names. This is because setxkbmap converts its arguments to
119 names of XKB configuration files according to files that are on the
120 client-side computer, then sends these file names to the server where
121 xkbcomp has to compose a complete keyboard map using files which the
122 server has. Thus if the sets of files differ in some way, the names
123 that setxkbmap generates can be unacceptable on the server side. You
124 can solve this problem by running the xkbcomp on the client side too.
125 With the -print option setxkbmap just prints the file names in an ap‐
126 propriate format to its stdout and this output can be piped directly to
127 the xkbcomp input. For example, the command
128
129 setxkbmap us -print | xkbcomp - $DISPLAY
130
131 makes both steps run on the same (client) machine and loads a keyboard
132 map into the server.
133
134
136 Xwayland is an X server that uses a Wayland Compositor as backend.
137 Xwayland acts as translation layer between the X protocol and the Way‐
138 land protocol but does not manage the keymaps - these are handled by
139 the Wayland Compositor.
140
141 Changing the keymap with setxkbmap is not supported by Xwayland. In
142 most instances, using setxkbmap on Xwayland is indicative of a bug in a
143 shell script and setxkbmap will print a warning. Use the Wayland Com‐
144 positor's native XKB configuration methods instead.
145
146
148 xkbcomp(1), xkeyboard-config(7)
149
151 /usr/share/X11/xkb
152
153
154
155X Version 11 setxkbmap 1.3.4 SETXKBMAP(1)