X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=pm-utils%2F40autorandr;h=74549fc49a7f4e64f7f932398b5c95e965ea7b18;hb=43bb98c613862cdf8cb81a49a03b30f70c706816;hp=43c17667f814bdfcded67a2060aeabe1bc630de1;hpb=399523da9b1ce32e798ea940224be595cf052972;p=deb_pkgs%2Fautorandr.git diff --git a/pm-utils/40autorandr b/pm-utils/40autorandr index 43c1766..74549fc 100755 --- a/pm-utils/40autorandr +++ b/pm-utils/40autorandr @@ -3,15 +3,24 @@ # 40autorandr: Change autorandr profile on thaw/resume exec > /var/log/autorandr.log 2>&1 -AUTORANDR="autorandr -c" +# detect if we are being called as 40auto-disper or 40autorandr +FORM=${0##*40} +case $FORM in + auto-disper) + AUTORANDR="auto-disper -c --default default" + ;; + *) + AUTORANDR="autorandr -c --default default" + ;; +esac detect_display() { for X in /tmp/.X11-unix/X*; do D="${X##/tmp/.X11-unix/X}" user=$(w -h | awk -vD="$D" '$3 ~ ":"D"(\\.[0-9])?$" {print $1}' | head -1) - logger "autorandr: Changing display configuration for user '$user'" if [ x"$user" != x"" ]; then + logger "autorandr: Changing display configuration for user '$user'" export DISPLAY=":$D" /bin/su -c "${AUTORANDR}" "$user" fi