betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

16 March 2012

Where to find all the setxkbmap options

They're not in the man page, but you've got them already

When configuring a keyboard on a unixish machine running X (aka X11, the X Windows System), nowadays the way to configure things is using setxkbmap(1). There's some good documentation in the manpage, but at some point the man page tells us only that there are options one can configure... but not what those possible options are. At first I went on a broad search through the web, until I figured that the directory path given at the top of the man page is a strong hint. In fact the list of predefined options can be found right on the system, in:


In that file we first find a list of keyboard "model" names, to be used like:

setxkbmap -model thinkpad

Next come the keyboard layouts, for various languages and configurations. These can be combined, like here where I'm using the Swiss (German) and the US keyboard alternatively - the stuff in the parenthesis is the "variant" - Swiss keyboards come in German or French:

setxkbmap 'ch(de),us'

The last big part of the list are all the "options" for setting up various keys and key combinations. So in my Swiss+US combo, I'm switching languages using Alt+Space (which is pretty close to how it's done on a Mac, given that the left Alt key is right next to the space bar). There are tons of options to switch keyboard layouts. I also have the Caps Lock key configured as a Control key - since in an setup, lots of stuff are done with the Ctrl key and I'm never using CapsLock anyway:

setxkbmap -option 'grp:alt_space_toggle,ctrl:nocaps' 'ch(de),us'

Multiple options are separated by comma. I'm single-quoting them, so no shell confusion - don't think it's strictly necessary.

There's also tons of options to set up various of the extra keys to be found on any average PC keyboard (5th level key anyone?) and for stuff like how to use the numerical keypad. Just have a look, it's right in your system!

Posted by betabug at 23:01 | Comments (5) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< Ελευθερία του λόγου | Main | An Evening at the Hackerspace >>
Re: Where to find all the setxkbmap options

Thank you for this information!

On my pangolin (ubuntu 12.04 ), the file the options are described in is "/usr/share/X11/xkb/rules/base.lst"

Incredible stuff in there, like:
"nbsp:zwnj2nb3nnb4 - Zero-width non-joiner character at second level, non-breakable space character at third level, thin non-breakable space at fourth level"


Posted by: eltomito at December 13,2012 17:37
Re: Where to find all the setxkbmap options

I found this page really useful when trying to set the keyboard layout in fvwm on my debian system. So, thank you very much.

Perhaps some of the information listed here should be incorporated into the man page.

Best wishes & thanks.
Roland, UK

Posted by: Roland at February 08,2016 08:35
Re: Where to find all the setxkbmap options

Hi Roland, my guess is that these options might change, and then the manpage would have to be updated. Instead the manpage points us where to look, which is good... but it took me a while to figure out that I'd have to actually go look there :-)

Posted by: betabug at February 09,2016 09:01
Re: Where to find all the setxkbmap options

Thanks a lot. Really helpful, got to point 2- search the web and saved me the next step - figuring out the path and where to look in :)

Posted by: Nikola at December 08,2018 22:56
Re: Where to find all the setxkbmap options


Posted by: bilabila at April 27,2019 05:35
You can trackback to:
There are no trackbacks.