From: Phillip Berndt Date: Mon, 7 Dec 2015 08:49:57 +0000 (+0100) Subject: pm-utils script: Check for xinit as a fallback X-Git-Tag: 1.0~35 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=53f7af43c6e0d597ebe7836c2d9aab94cc5d28d3 pm-utils script: Check for xinit as a fallback --- diff --git a/contrib/pm-utils/40autorandr b/contrib/pm-utils/40autorandr index 80cda11..264ba5f 100755 --- a/contrib/pm-utils/40autorandr +++ b/contrib/pm-utils/40autorandr @@ -16,6 +16,11 @@ detect_display() # Prefer w to who, see bug #39 if [ -x "`which w`" ]; then user="`w -h | awk -vD="$D" '$2 ~ ":"D"(.[0-9])?$" || $3 ~ ":"D"(.[0-9])?$" {print $1}' | head -n1`" + + if [ -z "$user" ]; then + # Try xinit as a fallback, see bug #39 + user="`w -h | awk -vD="$D" '$7 ~ "xinit" && $0 ~ ":"D"(.[0-9])?" {print $1}' | head -n1`" + fi else user="`who --all | awk -vD="$D" '$3 ~ ":"D"(.[0-9])?$" {print $1}' | head -1`" fi