From: Phillip Berndt Date: Wed, 10 Feb 2016 14:05:17 +0000 (+0100) Subject: Merge github.com:Idolf/autorandr X-Git-Tag: 1.0~28 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=e1b9a6b11247259c710209eede3d3fd288416233;hp=105e2954ceaac549670b91c3d60cd0e03ba0718b Merge github.com:Idolf/autorandr --- diff --git a/contrib/pm-utils/40autorandr b/contrib/pm-utils/40autorandr index 6dcb086..f44739a 100755 --- a/contrib/pm-utils/40autorandr +++ b/contrib/pm-utils/40autorandr @@ -10,10 +10,6 @@ export PROCPS_USERLEN=32 detect_display() { - # Wait for the system to recognize the changed state, see bug #30 - # Note the ampersand below, this runs asynchroneously. - sleep 5 - for X in /tmp/.X11-unix/X*; do D="${X##/tmp/.X11-unix/X}" # Prefer w to who, see bug #39 @@ -43,8 +39,12 @@ 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 & + detect_display ;; esac diff --git a/contrib/udev/40-monitor-hotplug.rules b/contrib/udev/40-monitor-hotplug.rules index 4c48ffb..7813bef 100644 --- a/contrib/udev/40-monitor-hotplug.rules +++ b/contrib/udev/40-monitor-hotplug.rules @@ -1 +1 @@ -ACTION=="change", SUBSYSTEM=="drm", RUN+="/etc/pm/sleep.d/40autorandr thaw" +ACTION=="change", SUBSYSTEM=="drm", RUN+="/etc/pm/sleep.d/40autorandr thaw udev"