loadkeys make permanent

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Message
Author
k829king
Posts: 104
Joined: 2018-08-26 09:47

loadkeys make permanent

#1 Post 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.

L_V
Posts: 1270
Joined: 2007-03-19 09:04

Re: loadkeys make permanent

#2 Post by L_V »

You should investigate this

Code: Select all

 dpkg-reconfigure locales console-data  keyboard-configuration

k829king
Posts: 104
Joined: 2018-08-26 09:47

Re: loadkeys make permanent

#3 Post 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 ...

L_V
Posts: 1270
Joined: 2007-03-19 09:04

Re: loadkeys make permanent

#4 Post 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

k829king
Posts: 104
Joined: 2018-08-26 09:47

Re: loadkeys make permanent

#5 Post 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.

L_V
Posts: 1270
Joined: 2007-03-19 09:04

Re: loadkeys make permanent

#6 Post 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.

k829king
Posts: 104
Joined: 2018-08-26 09:47

Re: loadkeys make permanent [SOLVED]

#7 Post by k829king »

thankyou that sorted it (and no not for root)

Post Reply