mirror of
https://github.com/phillipberndt/autorandr
synced 2025-02-17 12:07:00 +00:00
udev rule: Dynamically call either systemd or autorandr directly depending on whether systemd unit is available
This commit is contained in:
parent
94ae61de9d
commit
ae1f18a060
3
Makefile
3
Makefile
@ -105,7 +105,8 @@ endif
|
|||||||
|
|
||||||
install_udev:
|
install_udev:
|
||||||
$(if $(UDEV_RULES_DIR),,$(error UDEV_RULES_DIR is not defined))
|
$(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)
|
ifeq (${USER},root)
|
||||||
udevadm control --reload-rules
|
udevadm control --reload-rules
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user