9

There is previous similar question but solution there didn't work for me in Ubuntu 16.04. I mean:

gkbd-keyboard-display -l us,intl

The commands below work but I want to be able to specify which layout variant not just basic layout or current one.

gkbd-keyboard-display -l us
gkbd-keyboard-display -g 1
3
  • I would guess that gkbd-keyboard-display -l 'us(inlt)' would or could work. Or use xkbprint -lg 1 -color "$DISPLAY" - | ps2pdf - > keybord_layout-grp-1.pdf get a PDF of the current layout. To change the layout temorary, use setxkbmap, see manual page for options.
    – Anders
    Jul 16, 2021 at 18:14
  • hmm, that PDF command didn't work for me. What's an alternate for gathering data on the keyboard and key mappings? Jan 12, 2023 at 2:08
  • 1
    @NicholasSaunders did you install ps2pdf , it is part of ghostscript package? I just tested Anders' command and it is working still, in Ubuntu 22.04
    – user.dz
    Jan 20, 2023 at 11:23

1 Answer 1

9

Well, found the trick after trying the GUI then watch which command it is launching.

~$ ps aux | grep gkbd
user      4158  0.2  3.5 470116 27048 ?        Sl   14:06   0:00 gkbd-keyboard-display -l us?intl
user      4178  0.0  0.1  21296   928 pts/11   S+   14:07   0:00 grep --color=auto gkbd

~$ pgrep -a gkbd
4158 gkbd-keyboard-display -l us    intl

~$ pgrep -a gkbd | hexdump -c
0000000   2   3   7   0       g   k   b   d   -   k   e   y   b   o   a
0000010   r   d   -   d   i   s   p   l   a   y       -   l       u   s
0000020  \t   a   l   t   -   i   n   t   l  \n                        
000002a

So, here is the command that works, which uses tab \t as separator:

gkbd-keyboard-display -l $'us\tintl'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .