11

I've been trying the "Developer console" in ChromeOS( dev mode), which is entered by Ctrl+Alt+Forward but when switching the keyboard layout with loadkeys cz I got an error saying Couldn't get a file descriptor referring to the console.

  • I get the same when chroot is entered from crosh, but in that case the layout set in ChromeOS is used, which is fine.

I can see that the keyboard code is correct with ls /usr/share/X11/xkb/symbols/

In addition I've found the response of loadkeysis the same in Crosh, only there is the language/layout inherited from the system setup.

Is there any other way to set the keyboard mapping/layout in shell?

Huge
  • 215
  • 1
  • 2
  • 7

1 Answers1

4

I don't know about ChromeOS, but I get this same error with loadkeys and setfont on my Arch Linux machine when inside a screen session. The fix is to use an explicit -C option to specify the console:

$ loadkeys -C /dev/console cz

If you don't have write access to the console, a different error will occur:

Couldn't open /dev/console

In this case, any means of providing the correct privileges will do. I just use sudo or you can change the owner:

sudo chown myusername:myusername /dev/console

Note that the X11 keyboard layouts are not used by loadkeys, which is for the text console. Instead the files are in /usr/share/kbd/keymaps and have a different format.

The cz layout should still be available, but a customized layout for X11 would need to be ported.

xerostomus
  • 339
  • 3
  • 6
Fox
  • 8,013
  • 1
  • 26
  • 44