From: Phillip Berndt Date: Tue, 22 Nov 2016 09:40:42 +0000 (+0100) Subject: udev rule: Dynamically call either systemd or autorandr directly depending on whether... X-Git-Tag: 1.1~6^2~4 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=ae1f18a06039ea2e9fae5a2729cf674f155f6139 udev rule: Dynamically call either systemd or autorandr directly depending on whether systemd unit is available --- diff --git a/Makefile b/Makefile index 6c3513c..8ce4906 100644 --- 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