From 7d127f5879a929868d0a69ff6cd37a0876f9bac2 Mon Sep 17 00:00:00 2001 From: Mathias Svensson Date: Thu, 4 Feb 2016 12:56:20 +0100 Subject: [PATCH] Implemented the suggestions --- contrib/pm-utils/40autorandr | 4 ++++ contrib/udev/40-monitor-hotplug.rules | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/pm-utils/40autorandr b/contrib/pm-utils/40autorandr index 4197224..0c10748 100755 --- a/contrib/pm-utils/40autorandr +++ b/contrib/pm-utils/40autorandr @@ -36,6 +36,10 @@ detect_display() done } +if grep -q systemd $(readlink -f $(awk '{print $1}' /proc/1/cmdline)) && [ "$2" = "udev" ]; then + exec /bin/systemctl start autorandr-resume.service +fi + case "$1" in thaw|resume) detect_display diff --git a/contrib/udev/40-monitor-hotplug.rules b/contrib/udev/40-monitor-hotplug.rules index 116bf86..7813bef 100644 --- a/contrib/udev/40-monitor-hotplug.rules +++ b/contrib/udev/40-monitor-hotplug.rules @@ -1 +1 @@ -ACTION=="change", SUBSYSTEM=="drm", RUN+="/bin/systemctl start autorandr-resume.service" +ACTION=="change", SUBSYSTEM=="drm", RUN+="/etc/pm/sleep.d/40autorandr thaw udev" -- 2.39.2