How Qubes installation manages keyboard layout?

Question: What exactly does Qubes do if 3 or more languages chosen during the installation?

I chose only english, but I speak 7 different languages and this is fricking nightmare… I added layouts in dom0(from KDE settings), but it doesn’t work.

Did you try to do it during the installation? It should work then.

No, that’s why I want to know:

You will be able to choose the key combination (e.g. ctrl+shift) to go over all three languages. You will also be able to choose shortcut keys for the first and second language (like left Super key and right Menu key).

What I want to know is what Qubes installation does under the hood in order for this to work, so I would do that after the installation, because obviously it’s not a solution to reinstall the whole system

1 Like

Ok, I created a dedicated topic for your question, so other users will be able to find answer more easily. Feel free to adjust the title.

1 Like

As for R4.1 (and probably R4.2): the approach of keyboard layout has been changed:

  1. There are layouts and layout switching settings inside dom0. There you should have your 7 layouts set. It does not matter if those were set during installation or after that (check docs how to manually set it, it recommended not to use XFCE layout settings for this).
  2. Qubes (VMs) should not manage their layout themself now. When layout switch shortcut is pressed - dom0 fires window event that is caught by qubes-core-admin-client in dom0 and propagated into the active qube (sometimes wrong qube, unfortunately). The propagated layout settings inside the qube are different, they will have current layout, like fr and us if current is not us. Other 5 layouts will not be used at any moment. And layout switch/toggle options should be removed to prevent breaking things (currently they are not, but this bug is in the process of fixing).

TL;DR: Currently in R4.1 the layout switch is broken anyway for anyone, it does not work reliably as it was on R4.0 because new approach has at least 3 issues. But the new approach with propagation is really better, when layout is managed in a centralized way, so eventually it will be working properly, too.

R4.1 released in feb 4 '22… so since then there’s no solution to this? Is this a joke?

Please link these 3 issues if you can, maybe I missed them.

Most of issues and reasons are described here (link to the comment):

Additional information can be found here:

1 Like

Thanks for that.

So how do you use multi-language keyboard layouts at the moment, what’s the workaround?

I tried multiple ways, none of them worked for me, sadly.

I also just tried to re-install the system with pre-installed languages.

I updated all the templates through through the qubes-manager.

I installed KDE as it says in the docs: KDE (desktop environment) | Qubes OS

Launched Personal qube and keyboard layout doesn’t work.
It does work in the dom0 however.

I have added additional keyboard layout after installation (Q->System Tools-> Keyboard->Layout → “Add” button) and using them for quite a while (more that a year). Switching between layouts with Left Alt + Left Shift and do not experience any issues. The only problem is that Qubes does not show anywhere what layout is currently active, but as I have only two layouts, it is not a problem for me.

P.S. Now when I think more I’m not sure if I have added it during the installation or after installation…

The installer (anaconda from fedora) modify this file:
/etc/X11/xorg.conf.d/00-keyboard.conf
e.g. from https://wiki.archlinux.org/title/Xorg/Keyboard_configuration#Using_X_configuration_files

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "cz,us"
        Option "XkbModel" "pc104"
        Option "XkbVariant" ",dvorak"
        Option "XkbOptions" "grp:win_space_toggle"
EndSection

The documentation that Balko reffer to is keyboard-layout-settings-not-behaving-correctly.
And as he said, there are sometimes some issues (see the links he posted for more details).

You can add an new item in the panel.
Right click on the panel > Panel > Add New Item > Keyboard Layouts

As the doc recommend:

leave the checkbox “Use system defaults” checked. Do not customize the keyboard layout here.
Set the system-wide layout and options for xorg with the localectl command in dom0.

See the archlinux wiki link I posted just above.

4 Likes

I switched to XFCE just to make sure.
Fun fact: I can use second language in AppVM, but I can’t use any other(5 out of 7).

I use KDE and it’s my preferable DE, but I tried gnome as well and it’s the same as KDE - keyboard layout doesn’t work at all in AppVMs.

That’s just crazy, if indeed this is the behavior, very disappointing. Didn’t expect this kind of bugs for a released version that is available for over a year and a half.

sometimes is not the case, it just doesn’t work as intended for me all the time.

I tried many things already, but none of them worked.

From a fresh install with 7 selected keyboard layout languages, what exactly I should do for this to work in AppVMs?

With only 2 layouts, it does not always fail, just sometimes.
With many, indeed it always failed when using the keymap to switch layouts.
(I’ve used only one keymap to switch between all layouts).

I tried with 4 layouts and the keymap failed (it always block on the third and get stuck).
When using the ‘keyboard layouts’ item from the panel, it did works.
I haven’t tested this extensively, but you could give it a try.

Thank you and other members for trying to help, but I think I’m not gonna use Qubes. The idea is amazing, but it’s buggy and limiting, even with simple things like this one with the layout.

KDE 4.0 (aka not KDE 4) also had keyboard layout switch broken for a year or so, if I am not mistaken.

But yes, I agree that issues like that should be blockers for new releases.

I think that should works with the panel item.

Also, from this comment: https://github.com/QubesOS/qubes-issues/issues/8035#issuecomment-1682418329,
the issue with a toggle keymap (e.g. grp:win_space_toggle) should be fixed.
But not yet with some other shorcuts like shift_caps_switch.

You can already do the fix by looking the commit (or wait an update).
You can also thanks Balko, as he’s the one (with others too) who are debugging this issue.

Notice that the Qubes OS team is small and there is a lot of work to do.

1 Like

Thank you, that’s appreciated.