Page 1 of 1

loadkeys make permanent

Posted: 2019-08-12 18:40
by k829king
In a non X Deb9 unit I have a mapping file that I load with loadkeys to remap a couple of keys during boot. I would like to make this change permanent. Where are the default keymaps held in Deb9 and would it be possible to save the modified (after loadkeys run) keymap with a unique name and set the unit to default to that on boot? To allow loadkeys to run for normal user I've had to mess with permissions, which would like to avoid.
K.

Re: loadkeys make permanent

Posted: 2019-08-12 19:04
by L_V
You should investigate this

Code: Select all

 dpkg-reconfigure locales console-data  keyboard-configuration

Re: loadkeys make permanent

Posted: 2019-08-13 18:04
by k829king
that seems to be about predefined locales and keyboards?
If there is doco about how to clone existing one apply loadkeys mapping and save as new name ...

Re: loadkeys make permanent

Posted: 2019-08-13 18:11
by L_V
If the keyboard is correctly configured, why do you still need loadkeys ?

Code: Select all

find /usr/share/keymaps/ -type f
Or if you need a really so specific custom key mapping, you can place your loadkeys command in /etc/rc.local and enable the systemd service

Code: Select all

#!/bin/sh -e
#
loadkeys my_specific_keymap

Code: Select all

systemctl enable rc-local.service

Re: loadkeys make permanent

Posted: 2019-08-14 18:14
by k829king
why - because I want Shift+Tab to be recognised (when no X is in use)
the following works when loaded via loadkeys but I had to change permissions to allow user to run the loadkeys.
string F91 = "\033[Z"
string F92 = "\033\033[Z"
keycode 15 = Tab F91
alt keycode 15 = Meta_Tab
shift alt keycode 15 = F92

- - -
there doesn't appear to be an /etc/rc.local in vanilla Deb9 ?
- - -
the format of /usr/share/keymaps/ seems different to what I see in dumpkeys so not sure if I can apply the above directly to one there.

Re: loadkeys make permanent

Posted: 2019-08-14 18:20
by L_V
k829king wrote: there doesn't appear to be an /etc/rc.local in vanilla Deb9 ?
No because not needed and disabled by default in systemd.
Then create it +

Code: Select all

chmod +x /etc/rc.local
or if only for root user, then /root/.bashrc could be used.

Re: loadkeys make permanent [SOLVED]

Posted: 2019-08-22 15:32
by k829king
thankyou that sorted it (and no not for root)