autorandr
autorandr copied to clipboard
udev rule should use SYSTEMD_WANTS
I don't know since which version of systemd SYSTEMD_WANTS is supported so I haven't filed a PR yet.
Triggering system services using SYSTEMD_WANTS is much easier and probably better supported.
The rule should be something like:
ACTION=="change", SUBSYSTEM=="drm", ENV{SYSTEMD_WANTS}+="autorandr.service"
IIRC, in the past, we couldn't use this since this only worked once - the second change wouldn't trigger the service execution anymore. #61, iirc.
If it doesn't trigger the second time, it's a bug in udev. Should we take it upstream?
This behaviour is documented in systemd.service(5), I'm quite certain it's intentional.
What's the behavior we're expecting that does not fulfill what SYSTEMD_WANTS provides?
Once you plug a screen in, the service should run once. Once you plug a screen out, the service should run again.
The key expectancy is that if you then connect the screen that you just unplugged again, autorandr should run again. Maybe they changed the behaviour - this used to be not the case.