3 # 40autorandr: Change autorandr profile on thaw/resume
4 exec > /var/log/autorandr.log 2>&1
6 # detect if we are being called as 40auto-disper or 40autorandr
10 AUTORANDR="auto-disper -c"
13 AUTORANDR="autorandr -c"
19 for X in /tmp/.X11-unix/X*; do
20 D="${X##/tmp/.X11-unix/X}"
21 user=$(w -h | awk -vD="$D" '$3 ~ ":"D"(\\.[0-9])?$" {print $1}' | head -1)
22 if [ x"$user" != x"" ]; then
23 logger "autorandr: Changing display configuration for user '$user'"
25 /bin/su -c "${AUTORANDR}" "$user"