X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=pm-utils%2F40autorandr;h=11291778c6b32dc28a479b562a0a2cd13bfef525;hb=e0dfa631a21d7d30424a4ba9dde26faeedfcd224;hp=4ce7790255d1041db62637f495d1625912306441;hpb=4db3b2ca3ae95ddc6005337ea47528f84ea73deb;p=deb_pkgs%2Fautorandr.git diff --git a/pm-utils/40autorandr b/pm-utils/40autorandr index 4ce7790..1129177 100755 --- a/pm-utils/40autorandr +++ b/pm-utils/40autorandr @@ -3,29 +3,19 @@ # 40autorandr: Change autorandr profile on thaw/resume exec > /var/log/autorandr.log 2>&1 -# detect if we are being called as 40auto-disper or 40autorandr -FORM=${0##*40} -case $FORM in - auto-disper) - AUTORANDR="auto-disper -c" - ;; - *) - AUTORANDR="autorandr -c" - ;; -esac +AUTORANDR="autorandr -c --default default" 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) + user=`who | awk -vD="$D" '$2 ~ ":"D"(.[0-9])?$" {print $1}' | head -1` if [ x"$user" != x"" ]; then logger "autorandr: Changing display configuration for user '$user'" export DISPLAY=":$D" /bin/su -c "${AUTORANDR}" "$user" fi done - echo "Done" } case "$1" in