This repository provides few udev(7) rules and some extra shell scripts. Those scripts are triggered by netlink uevents via udev(7).
Scripts are device-manager agnostics. They can be used by the busybox(1) mdev applet or within an home-made helper script (/sbin/hotplug).
hotplug-drm(7) - splits drm uevent into card's connectors uevents
hotplug-monitor(7) - setups monitor upon card's connector uevent
hotplug-drm and hotplug-monitor are both shell scripts triggered by udev(7).
Because there is an uevent on card change but not on its connector, a script has to trigger it manually.
The goal of hotplug-drm is to split the drm uevent on card change into a sub-uevent on the card's connector. The script saves all connector's states under the /tmp/hotplug-drm directory to trigger a connector uevent only if its status has changed.
hotplug-monitor is triggered by the connector sub-uevent mentioned above. It setups the monitors layout using xrandr(1) according to a very simple ini style configuration file. This file is located either under /usr/etc/hotplug-monitor.conf or /etc/hotplug-monitor.conf.
/usr/etc/hotplug-monitor.conf Configuration file for hotplug-monitor(7).
/tmp/hotplug-drm Temporary directory used by hotplug-drm(7) to save connectors states.
hotplug-monitor needs bash. It uses arrays to handle the conffile content line-by-line, and replacement substitution.
Report bugs at https://github.com/gazoo74/udev-rules/issues
Written by Gaël PORTAY gael.portay@savoirfairelinux.com
udev(7), netlink(7), xrandr(1)
Copyright (c) 2017 Gaël PORTAY
This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.