]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Make user name detection more reliable if there are multiple session (e.g. terminals).
authorHermann Kraus <hermr2d2@gmail.com>
Sun, 17 Nov 2013 23:33:18 +0000 (00:33 +0100)
committerHermann Kraus <hermr2d2@gmail.com>
Sun, 17 Nov 2013 23:33:18 +0000 (00:33 +0100)
pm-utils/40autorandr

index 1dcb856ed5a0fdd2da81eb692037e66306964e29..43c17667f814bdfcded67a2060aeabe1bc630de1 100755 (executable)
@@ -9,8 +9,8 @@ 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}'`
-               logger "user $user"
+               user=$(w -h | awk -vD="$D" '$3 ~ ":"D"(\\.[0-9])?$" {print $1}' | head -1)
+               logger "autorandr: Changing display configuration for user '$user'"
                if [ x"$user" != x"" ]; then
                        export DISPLAY=":$D"
                        /bin/su -c "${AUTORANDR}" "$user"