X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fpm-utils%2F40autorandr;h=a80926091539b6bb9c4cfe768f074e697ddd363f;hb=bae286948aaeced03357adccfb14d1ce84a568d1;hp=264ba5f671b15baf06e8059cbfe5bb216cfbc4ae;hpb=53f7af43c6e0d597ebe7836c2d9aab94cc5d28d3;p=deb_pkgs%2Fautorandr.git diff --git a/contrib/pm-utils/40autorandr b/contrib/pm-utils/40autorandr index 264ba5f..a809260 100755 --- a/contrib/pm-utils/40autorandr +++ b/contrib/pm-utils/40autorandr @@ -3,38 +3,8 @@ # 40autorandr: Change autorandr profile on thaw/resume exec > /var/log/autorandr.log 2>&1 -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 - if [ -x "`which w`" ]; then - user="`w -h | awk -vD="$D" '$2 ~ ":"D"(.[0-9])?$" || $3 ~ ":"D"(.[0-9])?$" {print $1}' | head -n1`" - - if [ -z "$user" ]; then - # Try xinit as a fallback, see bug #39 - user="`w -h | awk -vD="$D" '$7 ~ "xinit" && $0 ~ ":"D"(.[0-9])?" {print $1}' | head -n1`" - fi - else - user="`who --all | awk -vD="$D" '$3 ~ ":"D"(.[0-9])?$" {print $1}' | head -1`" - fi - - if [ x"$user" != x"" ]; then - logger "autorandr: Changing display configuration for user '$user'" - export DISPLAY=":$D" - /bin/su -c "${AUTORANDR}" "$user" - fi - done -} - case "$1" in thaw|resume) - detect_display & + autorandr --batch -c --default default ;; esac