You are not logged in.
I have a script that I use to set up the resolution, orientation and layout of all connected screens. It does different things depending on whether the screen is HDMI or DP, adjusts default sound devices for ALSA, and a bunch of other things. The problem is that I need to run this script manually whenever I connect or disconnect an external monitor, which is inconvenient. So, the question is, is there any tool I can use to register a script to be run whenever the set of connected monitors changes? I had a look at acpid, but it seems it does not support monitor events?
Offline
A udev rule + SYSTEMD_WANTS + a service file for your script...
See `man systemd.device` for the details.
Offline