X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=inline;f=contrib%2Fpm-utils%2F40autorandr;h=0c107486113bb7552134831877fa9f49a33bbfec;hb=7d127f5879a929868d0a69ff6cd37a0876f9bac2;hp=8a66f3971f84d408e322e8ef0c692e0f892c8d43;hpb=adb35ed8a70b28eb5e42be778a5d323e6d41b532;p=deb_pkgs%2Fautorandr.git diff --git a/contrib/pm-utils/40autorandr b/contrib/pm-utils/40autorandr index 8a66f39..0c10748 100755 --- a/contrib/pm-utils/40autorandr +++ b/contrib/pm-utils/40autorandr @@ -7,10 +7,6 @@ AUTORANDR="autorandr -c --default default" 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 @@ -40,8 +36,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