8

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
user.dz
  • 47,137
  • 13
  • 140
  • 258
  • 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 '21 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? – Nicholas Saunders Jan 12 '23 at 02: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 '23 at 11:23

1 Answers1

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'
user.dz
  • 47,137
  • 13
  • 140
  • 258