I am writing a UDEV rule to change the display settings when the external monitor plugs-in or plugs-out. The rule is working perfectly fine.

Randomly, the script doesn' t work. After inspection, I found the following event is not happening upon device insertion/removal.

KERNEL[1382.370]  change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
UDEV  [1385.939]  change  /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)

Even if I wait for more than 60sec, the event is not happening. But as soon as I execute command xrandr, the event happens.

What could it be?


I had a similiar problem.
I fixed it by adding xrandr >/dev/null before the first line in the script.

I don't know why, but without it, it's not working.

| improve this answer | |
  • This fixed the script for me too. Have you found out why this is the observed behavior in the meantime? – Tim Hilt Aug 26 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.