From: Mandus Elfving Date: Wed, 10 Apr 2013 18:05:26 +0000 (+0200) Subject: Some small fixes to the pm-utils script X-Git-Tag: 1.0~155^2~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a0ace8e0c7b145a91084c87edcf25d785640080e;p=deb_pkgs%2Fautorandr.git Some small fixes to the pm-utils script --- diff --git a/pm-utils/40autorandr b/pm-utils/40autorandr index 60ca9ae..1dcb856 100755 --- a/pm-utils/40autorandr +++ b/pm-utils/40autorandr @@ -1,6 +1,7 @@ #!/bin/sh # # 40autorandr: Change autorandr profile on thaw/resume +exec > /var/log/autorandr.log 2>&1 AUTORANDR="autorandr -c" @@ -8,7 +9,8 @@ detect_display() { for X in /tmp/.X11-unix/X*; do D="${X##/tmp/.X11-unix/X}" - user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}') + user=`w -h | awk -vD="$D" '$3 ~ ":"D"(\\.[0-9])?$" {print $1}'` + logger "user $user" if [ x"$user" != x"" ]; then export DISPLAY=":$D" /bin/su -c "${AUTORANDR}" "$user"