]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - contrib/pm-utils/40autorandr
Fixes in 40autorandr; thanks to @rnav for spotting the issues
[deb_pkgs/autorandr.git] / contrib / pm-utils / 40autorandr
index ab022631eed93ff08638094a69cec93fbb1d86fc..0e029af23e9f079b41ebc04293bc2990aea5d63f 100755 (executable)
@@ -12,7 +12,7 @@ find_user() {
        # Determine user owning the display session from $1
        D="$1"
 
-       # Prefer loginctl over all others, see bug #49
+       # Prefer loginctl over all others, see bug #39
        if [ -x "`which loginctl`" ]; then
                # Based on http://unix.stackexchange.com/questions/203844/how-to-find-out-the-current-active-xserver-display-number/204498
                # by SO user intelfx
@@ -34,7 +34,6 @@ find_user() {
                        done
                done
                )"
-               user=
                if [ -n "$user" ]; then
                        echo $user
                        return 0
@@ -60,7 +59,6 @@ find_user() {
                fi
        fi
 
-       user=
        if [ -n "$user" ]; then
                echo $user
                return 0
@@ -96,7 +94,7 @@ detect_display()
        for X in /tmp/.X11-unix/X*; do
                D="${X##/tmp/.X11-unix/X}"
 
-               user="$(find_user "$D")"
+               user="$(find_user ":$D")"
 
                if [ x"$user" != x"" ]; then
                        logger "autorandr: Changing display configuration for display :$D, user '$user'"