If you force the load of the .Xmodmap by adding the command 'xmodmap ~/.Xmodmap' in the Startup Applications, all is reverted if you suspend/resume or if you change the user and get back etc. So I managed to adapt some snippets I found, using the python dbus interface to reissue the command when resuming, changing the keyboard layout or changing sessions. It can be saved as /usr/local/bin/user-xmodmap-reload-hack (or other path/name) and then added to the Startup Applications.
I didn't test it very much and I don't have much code experience, so you are welcome to modify.
If you force the load of the .Xmodmap by adding the command 'xmodmap ~/.Xmodmap' in the Startup Applications, all is reverted if you suspend/resume or if you change the user and get back etc. So I managed to adapt some snippets I found, using the python dbus interface to reissue the command when resuming, changing the keyboard layout or changing sessions. It can be saved as /usr/local/ bin/user- xmodmap- reload- hack (or other path/name) and then added to the Startup Applications.
I didn't test it very much and I don't have much code experience, so you are welcome to modify.