Not so knowledgable about X window system. First, can that be donethrough XKB-extension, which is the better approach? Second, xmodmapsetting changes with plugging out the input device, and doesn'tsupport hot-plugging.
In a previous thread in the list, someone suggested using `inputplug`from: https://github.com/andrewshadura/inputplug To run the script anytime ‘xmodmap’ configuration is lost. -- Best Regards,Abraham Sent with Tutanota; https://tuta.com