Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Udev Rule No Longer Working After Package Upgrade on Arch Linux #398

Open
9las opened this issue Nov 16, 2024 · 1 comment
Open

Udev Rule No Longer Working After Package Upgrade on Arch Linux #398

9las opened this issue Nov 16, 2024 · 1 comment

Comments

@9las
Copy link

9las commented Nov 16, 2024

Hi everyone,

After a recent package upgrade on my Arch Linux system, I noticed that Autorandr stopped automatically switching display configurations when I plugged in or unplugged an external monitor. Despite this issue, running autorandr --detected correctly identified the connected displays, and manually executing autorandr --change worked as expected.

The Issue

To troubleshoot, I ran the following command to monitor udev events:

udevadm monitor --environment --udev

Upon unplugging and re-plugging my external monitor, I observed this output:

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing

UDEV  [6599.927057] online   /devices/system/container/PRP00001:00 (container)
ACTION=online
DEVPATH=/devices/system/container/PRP00001:00
SUBSYSTEM=container
SEQNUM=7788
USEC_INITIALIZED=6599923438

UDEV  [6606.747288] online   /devices/system/container/PRP00001:00 (container)
ACTION=online
DEVPATH=/devices/system/container/PRP00001:00
SUBSYSTEM=container
SEQNUM=7789
USEC_INITIALIZED=6606743526

From this output, I discovered that the udev events for monitor changes were now being registered under the container subsystem with ACTION=online, instead of the expected drm subsystem with ACTION=change.

Solution

To fix this, I updated the udev rule located at:

/usr/lib/udev/rules.d/40-monitor-hotplug.rules

I changed:

- ACTION=="change", SUBSYSTEM=="drm"
+ ACTION=="online", SUBSYSTEM=="container"

After making these changes, I reloaded the udev rules with:

sudo udevadm control --reload-rules
sudo udevadm trigger

This resolved the issue, and Autorandr now automatically switches display configurations as expected.

@tyilo
Copy link

tyilo commented Nov 21, 2024

I have just updated my Arch Linux system today and my udev rule triggers autorandr fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants