]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Merge github.com:Idolf/autorandr
authorPhillip Berndt <phillip.berndt@googlemail.com>
Wed, 10 Feb 2016 14:05:17 +0000 (15:05 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Wed, 10 Feb 2016 14:05:17 +0000 (15:05 +0100)
contrib/pm-utils/40autorandr
contrib/udev/40-monitor-hotplug.rules

index 6dcb086d2c8c083f1cb554c5e274307083e06642..f44739a609e2aa032ed868c584a773d48851c234 100755 (executable)
@@ -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
index 4c48ffb0f7ce0ad7116d43a34e18dc7966502579..7813befcb9a4f23a3a3dece5a48174836f40121f 100644 (file)
@@ -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"