Hello again, tldr; My question is, how can I get HDMI Events, I want to execute scripts when a new HDMI (or DP, for that matter) device is connected or disconnected. Maybe there is a really obvious or simple way or solution but I did not see it.
Reading the man page for kqueue, I was very excited to see that I can monitor for HDMI changes EVFILT_DEVICE and NOTE_CHANGE. But I do not see how I could use it, I am not sure what would be the descriptor to watch for in this case. Also the perl kqueue cpan module does not contain the EVFILT_DEVICE stuff. I tried anyway using values defined in the .h files, tried to use various outputs like pci device number etc. as a descriptor but it did not work. Using incron does also not work as it only concentrates on files. I checked the hotplugd but did not get anywhere either. Then reading the source of drm etc. and I see that at least HDMI changes do send NOTE_CHANGE events to kqueue, so they should be there. Using xev with the -event randr should print randr events, and I thought HDMI connects or disconnects should be events randr talks about, but it does not work. I am very interested in this because I created a set of scripts which check the EDID output and stuff and create a hash and based on that executes defined scripts so in my home, the monitor is left of the laptop, but in the office, it is actually right of the laptop for reasons. And when I am on the road it just turns off the other outputs, but now I have to I3 bindsym a key binding to execute it when I come home from work and connect the monitor. Thank you Rai

