Use case: I want to be able to specify within my user account that custom setxkbmap/xkbcomp commands shall be run when I connect a specific keyboard to the machine. Currently I can see two suboptimal alternatives: 1. define the rule administratively, as a root, system-wide, perhaps with some detection of currently interactively logged users 2. make a script that will be continually parsing output of "udevadm monitor" and respond appropriatelly to specific events #1 may not always be available and seems overkill for fulfilling needs of just a single user. #2 seems a duplication of what udev already offers natively. Is there any other solution I am currently missing? If not, would it be possible to consider a way to expose udev rules configuration on per-user basis?
I don't think we can support anything like this. Apart from the problem that privileges are required to create the rule (what you describe), there's the problem that the program started by udev and running under root would have to somehow communicate back to the user services. Sorry!
I hope you at least agree on how paradox this is: user has all the inputs needed (via "udevadm monitor" or likely directly via libudev when more suitable), but is left to implement (or reuse the wheel reinvented by someone else) the rule engine on her own as the system-wide is not willing to support common users.
Created attachment 1057716 [details] Sample implementation of solution #2. To be invoked, e.g., from ~/.xinitrc.