How to display the current keyboard layout?

22,415

Solution 1

xkeycaps seems to do what you want, if I understand you correctly.

enter image description here

Solution 2

From the command line: gkbd-keyboard-display -l <layout>.

gkbd-keyboard-display screenshot

To see what your installed keyboards are (for example to find the layout code to use in the command above) use setxkbmap -query.

Solution 3

Selecting the current layout with gkbd-keyboard-display is possible like so:

#! /usr/bin/env fish
set layout (setxkbmap -query | grep layout | tr -s ' ' | cut -d ' ' -f2)
set variant (setxkbmap -query | grep variant | tr -s ' ' | cut -d ' ' -f2)
gkbd-keyboard-display -l $layout\t$variant

Or, similarly:

#! /bin/bash
layout=`setxkbmap -query | grep layout | tr -s ' ' | cut -d ' ' -f2`
variant=`setxkbmap -query | grep variant | tr -s ' ' | cut -d ' ' -f2`
gkbd-keyboard-display -l ${layout}$'\t'${variant}

Solution 4

You can use xkbprint to print the current layout.

For example to print the current layout as PDF use

xkbprint -color "${DISPLAY}" - |\
    ps2pdf - > current_keyboard_layout.pdf

which produces:

xkbprint result

Solution 5

Manjaro Settings Manager > Keyboard Settings

It looks like this:

Keyboard Settings in Manjaro Settings Manager

Share:
22,415

Related videos on Youtube

landroni
Author by

landroni

Updated on September 18, 2022

Comments

  • landroni
    landroni over 1 year

    Is there a utility that allows to graphically display the current keyboard layout?

    This can be useful, for example, when writing in a foreign language and having the physical keyboard only indicating the local language (positioning of symbols, etc.). I would like to get a display similar to the following: enter image description here

  • landroni
    landroni over 10 years
    Indeed! I had it installed, but forgot the command.
  • Alex Stragies
    Alex Stragies over 7 years
    This will not work (= display the current mapping visually as a picture), if the user has made changes to the keysyms with e.g. xmodmap. If you mouseover the changed key(s), the keysym line in the top half of the xkeycaps is updated correctly though. I am researching the same question, but I have made lots of changes with xmodmap. So I was looking for a nice means to display current key mappings too.
  • Colonel Panic
    Colonel Panic over 2 years
    IMHO this is the nicest diagram, although it doesn't distinguish dead keys in any way gitlab.gnome.org/GNOME/libgnomekbd/-/issues/10