Solved How to use kbdmap from script?

I'm trying to run kbdmap from a script, interactively, and put the user's selection into a shell variable.
The installer somehow manages to do that, but I get lots of weird results trying to integrate it in a shell command.

E.g. echo `kbdmap` gives me this output:

Code:
lang_default = en
dialect = en
lan_abk = en

what I really want is kbdmap's output like the one it prints after interactive use, such as

Code:
keymap="german.iso.kbd"

Ultimately, I want to do the equivalent of sysrc `kbdmap`.
 
Found it.
Did a bit of digging in the installer scripts, looks like it's reimplemented `kbdmap`, found the actual configuration script is `bsdconfig`, and finally found that since I want to configure sc instead of vt, I need to do `bsdconfig syscons_keymap` anyway.

I have to say that console configuration is currently a steaming pile of unfit-for-its-purpose. All the configuration seems duplicated but if you don't know there are two subsystems that require different programs to configure, and no documentation that explains what's currently there and which programs are suitable for what purpose, this is an entry barrier for people who want to work with just the console (and sometimes it confuses X users as well). I guess there should be a single source of truth for all environments, and subsystems should derive their configuration from that... but I'm dreaming, I know :-)
 
Back
Top