2012-01-18 21:07:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2012-02-15 19:53:13 +00:00
|
|
|
# 40autorandr: Change autorandr profile on thaw/resume
|
2013-04-10 18:05:26 +00:00
|
|
|
exec > /var/log/autorandr.log 2>&1
|
2012-01-18 21:07:01 +00:00
|
|
|
|
|
|
|
AUTORANDR="autorandr -c"
|
|
|
|
|
|
|
|
detect_display()
|
|
|
|
{
|
2012-02-12 22:22:19 +00:00
|
|
|
for X in /tmp/.X11-unix/X*; do
|
|
|
|
D="${X##/tmp/.X11-unix/X}"
|
2013-04-10 18:05:26 +00:00
|
|
|
user=`w -h | awk -vD="$D" '$3 ~ ":"D"(\\.[0-9])?$" {print $1}'`
|
|
|
|
logger "user $user"
|
2012-01-18 21:07:01 +00:00
|
|
|
if [ x"$user" != x"" ]; then
|
2012-02-15 19:53:13 +00:00
|
|
|
export DISPLAY=":$D"
|
2012-01-18 21:07:01 +00:00
|
|
|
/bin/su -c "${AUTORANDR}" "$user"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
thaw|resume)
|
|
|
|
detect_display
|
|
|
|
;;
|
|
|
|
esac
|