The devices I work with and develop on are made by a Danish company. Whenever we ssh into into the Debian 8 based devices, they keyboard layout is US QWERTY, but if we attach a US USB keyboard to the device itself, they keyboard layout is Danish.
I've been trying to find a simple way to set the keyboard layout across all 10 virtual terminals, as we use them for development purposes. (They are a mingetty run by a systemd service on boot).
I've found that I can somewhat successfully change the layout to US if I:
- Am SSH'd into the device
- Edit
/etc/default/keyboardmanually to haveXKBLAYOUT="us"instead ofXKBLAYOUT="dk" - Run
udevadm trigger --subsystem-match=input --action=change
However, it didn't change the layout for Virtual Terminals that I then log into locally afterward.
I can successfully change the layout to US for all VTs if I:
- Am SSH'd into the device or am logged in locally
- Edit
/etc/default/keyboardmanually to haveXKBLAYOUT="us"instead ofXKBLAYOUT="dk" - Reboot the device
Is there any other way to get these changes to stick without having to restart the whole device?
I know that all I need to do is change the XKBLAYOUT so when I've tried using setxkbmap -model pc105 -layout us I get back Cannot open display "default display" back. Note: When I ssh or locally login to the device I am root, and have been running all commands as root.
My /etc/default/keyboard file is very simple:
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="dk"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
My goal is to script the process so all QA has to do is run a simple script to change back and fourth between US (So they can type more easily) and Danish (So they can set the device back to be as similar to production devices as possible).
udevadm trigger --subsystem-match=input --action=changeto apply the change for X. I thought it wouldn't work for me, but it does. (at least for all the non X terminals).