]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Display logger information in pm-utils script only if a user was actually found
authorPhillip Berndt <phillip.berndt@googlemail.com>
Fri, 29 Nov 2013 07:04:18 +0000 (08:04 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Fri, 29 Nov 2013 07:04:18 +0000 (08:04 +0100)
pm-utils/40autorandr

index 43c17667f814bdfcded67a2060aeabe1bc630de1..fc97dea3875a1232e8fb5a3eaf23316a848f39c1 100755 (executable)
@@ -10,8 +10,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}' | head -1)
-               logger "autorandr: Changing display configuration for user '$user'"
                if [ x"$user" != x"" ]; then
+                       logger "autorandr: Changing display configuration for user '$user'"
                        export DISPLAY=":$D"
                        /bin/su -c "${AUTORANDR}" "$user"
                fi