]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
udev rule: Dynamically call either systemd or autorandr directly depending on whether...
authorPhillip Berndt <phillip.berndt@googlemail.com>
Tue, 22 Nov 2016 09:40:42 +0000 (10:40 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Fri, 20 Jan 2017 14:14:15 +0000 (15:14 +0100)
Makefile

index 6c3513c698ee746be2afd335da9255fb6ac22084..8ce4906ea200fb958f3ceda1a19006f65d498dbe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -105,7 +105,8 @@ endif
 
 install_udev:
        $(if $(UDEV_RULES_DIR),,$(error UDEV_RULES_DIR is not defined))
-       install -D -m 644 contrib/udev/40-monitor-hotplug.rules ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
+       mkdir -p ${DESTDIR}/${UDEV_RULES_DIR}/
+       echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(TARGETS)),/bin/systemctl start autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
 ifeq (${USER},root)
        udevadm control --reload-rules
 else