On 13.03.2013 11:04, Olivier Médoc wrote:
> On 03/08/13 14:53, Marek Marczykowski wrote:
>> On 07.03.2013 13:32, Olivier Médoc wrote:
>>> Hello,
>>>
>>> The keyboard layouts are not propagated to the appvm (I user azerty keyboard,
>>> but when I start a VM, the keyboard is set to qwertz). This problem only
>>> appears for fedora-18 appvms but not for the fedora-18 template.
>>>
>>> 1/ It is not possible to define default keyboard layout once the user selected
>>> one from the qubes manager. I attached a patch to the qubes-gui repo in order
>>> to allow selection of a 'none' layout (Qubes default layout).
>> setxkbmap -v -print should also work instead of plain "setxkbmap -v". IMO
>> getting current setting from GNOME specific application isn't the right option
>> (especially if gnome-settings-daemon isn't running).
> Ok, I have 4 values:
> - The value coming from xenstore
> - The value coming from xkbmap
> - The value coming from xkbcomp (X11 display :0)
> - The value coming from gsettings
And the fifth:
- The value coming from ~/.config/qubes-keyboard-layout.rc (see below)
> If the keyboard from xkbmap is us (which is the default):
> 1/if xkbcomp and xenstore layout are matching and are different than us,
> it means that the user didn't selected any specific keymap
> 2/if xkbcomp and xenstore layout are matching and are us, the user
> probably doesn't care about the keymap.
>
> So if xkbcomp and xenstore layout are matching, and xkbmap layout is us, it
> means that the user use the default keymap ?
I think the better idea is to always save custom layout in
qubes-keyboard-layout.rc. If the file doesn't exists - it means "default
layout". Also setting layout to default should result in removing the file.
There is one more problem: keyboard layout can specify multiple groups
(multiple layout with possibility to switch between them). Example:
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include
"pc+pl+us(colemak):2+inet(evdev)+terminate(ctrl_alt_bksp)" };
xkb_geometry { include "pc(pc105)" };
};
Same can be obtained from xkbcomp.
I don't know how to get (or set) currently used group from script (i.e. not
from keyboard layout tray icon). So currently setting more than one layout
causes problems. It's okay for now (just one more point on Known Issues
list...), but it will be nice to solve it some day.
> I can modify the patch following this rule...
>>
>>> 2/ I finally found the real culprit:
>>> /etc/xdg/autostart/gnome-settings-daemon.desktop, which ends with
>>> OnlyShowIn=GNOME;AppVM;
>>>
>>> As a consequence, when running an appvm, gnome-settings starts (after
>>> /etc/X11/xinit/xinitrc.d/qubes-keyboard.sh). If not specific keyboard settings
>>> are found (which is the case if the user want to use default qubes keymap),
>>> gnome-settings apparently set the keyboard layout to 'us'.
>>>
>>> You can just remove AppVM from gnome-settings-daemon.desktop to fix this.
>>>
>>>
>>> Is gnome-settings-daemon really necessary in our case ? What is the correct
>>> way to fix this problem ?
>> It isn't but it will be started by some application anyway (e.g.
>> gnome-terminal). I'd like to disable setting keyboard layout by gsd, but I
>> don't know how. KDE equivalent have "use system default" option, but gnome
>> hasn't... Do you have some idea? Perhaps qubes_keyboard.sh script should set
>> it according to layout received from dom0?
> Apparently, gnome-terminal doesn't really care about the gsettings daemon and
> doesn't start it. Also if gnome-settings isn't running, I can still use the
> gsettings command and that won't start gnome-settings-daemon (or gsd). So I
> don't really know if this deamon is required or if it just initialize things
> for the gnome desktop (not the apps).
>
> qubes_keyboard.sh is started before xdg applications, which make this not so
> easy to solve. Also qubes_keyboard actually set the layout received from dom0
> using xkbcomp.
If gnome-settings-daemon will not be running we can ignore gsettings.
qubes-change-keyboard-layout currently uses gsettings as primary source and
config file as fallback. Without gsettings it can use config file as primary
config (perhaps still saving layout additionally in gsettings - to not break
keyboard layout if anyone start gsd manually). This should be easy to handle
from qubes_keyboard (which already uses config file, but as fallback to
gsettings).
> My point is still that gsettings-daemon should be disabled as it doesn't seems
> necessary (at least I never had problems running gnome applications without
> gsd running). But maybe I missed something.
Ok, can try. So you can change OnlyShowIn line in
/etc/xdg/autostart/gnome-settings-daemon.desktop in template (remove AppVM
from there). I will do the same on my system. If nothing will break, then will
make it default.
First thing I see: settings from gnome-control-center aren't applied anymore
(not surprised). But it should be a problem, because I don't there any useful
things besides keyboard layout.