2

I guess the answer is no, but still worth a try getting it documented

To dump the current console keymap, dumpkeys can be used. But is there any way to get the original name back? (That can be used to call loadkeys with the original system mapfiles)

The scenario is a system that is started (livecd, or any system) - but then a chroot is created to create a new installation. Is there any way to get the keymap name that should be used in the configuration of the system in chroot.

The only way I can think of right now is to use dumpkeys to get existing map, and then loadkeys on all existing keymaps in the new chroot, and then dumpkeys on the loaded one and compare with the original.

1

If present on your system try;

localectl status

the output includes (among other info) the virtual console keymap setting.

Filtered through awk:

localectl status | awk 'NR==2 {print $3}'

returns only the actual name of the console keymap.

  • 1
    Seems that localectl is part of systemd? If you use loadkeys to set a different keymap will localectlthen show the correct output? freedesktop.org/software/systemd/man/localectl.html – NiKiZe Aug 2 '17 at 14:44
  • localectl doesn't seem to detect the changes made by loadkeys meaning the tool in question needs to be used to adjust the keymap, in order for the change to be detected i.e. localectl set-keymap uk. While at it it also alters the system files accordingly (in my case /etc/vconsole.conf) which makes this change permanent. And yes, I believe it is part of systemd suite. – soocki Aug 2 '17 at 15:49
  • 1
    It is part of systemd see the documentation I linked to. So it only saves it's internal state to file and that is where it is loaded from - which makes it unusable when you don't know how the system is booted and are in a chroot with a new system, and not the original system that might or might not have systemd, and even if it has the startup scripts or the user might just as well have used loadkeys anyway. – NiKiZe Aug 2 '17 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.