I have a laptop with builtin US keyboard, and an external USB keyboard in FR layout used when docked. When booting, because my disk is encrypted, I need to enter the passphrase for LUKS. Because the keyboard I'll use depends on whether I'm docked or not, I need to be able to switch layout. For this to happen, I use the `localectl set-keymap us fr` command then rebuilt the initramfs (this changes `/etc/vconsole.conf`). But actually I wasn't able to test if that works yet. Still, it appears that if I set the X11 keyboard similarly, this overrides the console layout: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # localectl set-keymap us fr # cat /etc/vconsole.conf KEYMAP=us FONT=eurlatgr XKBLAYOUT=us KEYMAP_TOGGLE=fr XKBMODEL=pc105+inet XKBOPTIONS=terminate:ctrl_alt_bksp -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Here above, XKBLAYOUT is now "us" only. -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # localectl set-x11-keymap us,fr # cat /etc/vconsole.conf KEYMAP=us FONT=eurlatgr XKBLAYOUT=us,fr -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Here above, XKBLAYOUT is now "us,fr" but console's KEYMAP_TOGGLE vanished. The only way I found to avoid overriding the settings is to first use "set-x11-keymap" then "set-keymap --no-convert": -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # localectl set-x11-keymap us,fr --> breaks console keyboard # localectl set-keymap us fr --no-convert --> sets back console keyboard without modifying X11 keyboard -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- IMHO neither "set-keymap" nor "set-x11-keymap" should modify the other's console settings. Reproducible: Always Steps to Reproduce: Setup a system with 2 keyboards
(In reply to Renaud Métrich from comment #0) > IMHO neither "set-keymap" nor "set-x11-keymap" should modify the other's > console settings. No, that's intentional and documented behavior. We want the settings to be in sync.
Yeah, keeping both in sync is the expected behaviour. If you need something different, it's OK to write some special configuration, but the automation provided by localed works like it does, and we want to keep it this way. It's the right thing for 99% of users.