"solved". Ugly, but works. Via a .desktop in ~/.config/autostart. The trick was to not run xmodmap immediately, but to delay it: sleep 2; xmodmap /home/user/...
For the record: ~/.config/autostart/xmodmap.desktop: [Desktop Entry] Type=Application Name=xmodmap Exec=/home/user/.config/xmodmap.sh X-GNOME-Autostart-enabled=true ~/.config/xmodmap.sh: sleep 2; xmodmap /home/user/.config/xmodmap ~/.config/xmodmap: remove Lock = Caps_Lock keycode 9 = Caps_Lock keycode 66 = Escape add Lock = Caps_Lock Also added to /etc/skel/ of the templates for future vms and dispvms. On Mon, Apr 17, 2023 at 3:25 PM Gabriel Philippe <gabri.phili...@gmail.com> wrote: > > Hi, > > I'm used to swapping CapsLock and Escape keys, but don't manage it to > do it through vms. Any help? > > Basically what I need is not more complicated than running xmodmap > config_file, where config_file is: > remove Lock = Caps_Lock > keycode 9 = Caps_Lock > keycode 66 = Escape > add Lock = Caps_Lock > > Several years ago I was using Qubes 3.2, and if I remember correctly I > only had to do it in dom0, then it was propagated to vms. This does > not work anymore in 4.1. > > Currently, when doing it in dom0 it works in dom0, but when starting a > vm I get this weird situation: > - CapsLock key does nothing, > - Escape key sends both Escape and CapsLock. > > I can manually run xmodmap config_file in vms, then it is fine, but I > can't automate it. At startup: > - ~/.Xmodmap is not read > - ~/.xsession is not executed > - /rw/config/rc.local is executed, but adding "xmodmap > /home/user/config_file" in it does nothing. > - I tried adding a script in the template, > /etc/X11/Xsession.d/99script, containing "xmodmap > /home/user/config_file", but it does not work either (though the > script is executed). > > I found this thread, but don't understand anything, and I can't figure > such a simple thing could be that complicated. > https://forum.qubes-os.org/t/remap-super-key-keyboard/4894 > > -- > Gabriel -- Gabriel -- You received this message because you are subscribed to the Google Groups "qubes-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/CAJ-6NAsgMQCrECs9cbUNMj1zT1Zp_hKZJAnrOjU4y%2B6tWTCrng%40mail.gmail.com.