phillipberndt / autorandr

Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
2.51k stars 124 forks source link

Question: should autorandr systemd service change profile when external monitor is unplugged? #360

Open carlotm opened 1 year ago

carlotm commented 1 year ago

I can't make autorandr to change the profile when the external monitor is unplugged.

Is it supposed to work? How can I debug what's going on?

Cheers

phillipberndt commented 1 year ago

The systemd unit isn't a service, it's started ad hoc as needed. What mechanism do you use to detect changes? udev? Generally, unplug should trigger autorandr.

carlotm commented 1 year ago

I am using this udev rule:

$ cat /etc/udev/rules.d/95-monitors.rules
ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/carloratm/.Xauthority", RUN+="/usr/bin/autorandr --change"

It is working when I plug a monitor, does not work when I unplug it