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?

4
  • 3
    Are you root? What is the output of ls -l /dev/console ? Feb 7, 2017 at 0:42
  • @Gilles Yes.( Although I thought that wouldn't be needed.) The listing gives a line crw-------. 1 root root 5, 1 Feb 6 14:53 /dev/console
    – Huge
    Feb 7, 2017 at 10:16
  • fgconsole produces this errormessage when not run from $TERM=linux (tty*) eg. xterm, konsole etc.
    – user261023
    Nov 17, 2017 at 11:23
  • 2
    note loadkeys loads from /usr/share/kbd/keymaps. you might try setxkbmap instead, though i wonder if that will still work under Freon.
    – quixotic
    Dec 19, 2017 at 19:29

1 Answer 1

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.

You must log in to answer this question.

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