autorandr icon indicating copy to clipboard operation
autorandr copied to clipboard

udev rule should use SYSTEMD_WANTS

Open thedrow opened this issue 7 years ago • 5 comments
trafficstars

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"

thedrow avatar Nov 15 '18 17:11 thedrow

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.

phillipberndt avatar Nov 15 '18 20:11 phillipberndt

If it doesn't trigger the second time, it's a bug in udev. Should we take it upstream?

thedrow avatar Nov 20 '18 13:11 thedrow

This behaviour is documented in systemd.service(5), I'm quite certain it's intentional.

phillipberndt avatar Nov 21 '18 11:11 phillipberndt

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.

thedrow avatar Nov 24 '18 09:11 thedrow

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.

phillipberndt avatar Nov 24 '18 09:11 phillipberndt