]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Some small fixes to the pm-utils script
authorMandus Elfving <mandus.elfving@gnifin.com>
Wed, 10 Apr 2013 18:05:26 +0000 (20:05 +0200)
committerHermann Kraus <hermr2d2@gmail.com>
Sun, 17 Nov 2013 23:21:38 +0000 (00:21 +0100)
pm-utils/40autorandr

index 60ca9ae8f374b3d4d9a1ab144863428758f546fb..1dcb856ed5a0fdd2da81eb692037e66306964e29 100755 (executable)
@@ -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"