From c67eb9c0efdc370bcce87fe02bc80df0b0c09ac8 Mon Sep 17 00:00:00 2001 From: Stefan Tomanek Date: Sun, 12 Feb 2012 23:10:54 +0100 Subject: [PATCH] optionally use xdpyinfo --- autorandr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/autorandr b/autorandr index 376b1ae..03333f9 100755 --- a/autorandr +++ b/autorandr @@ -46,6 +46,7 @@ XRANDR=/usr/bin/xrandr DISPER=/usr/bin/disper +XDPYINFO=/usr/bin/xdpyinfo PROFILES=~/.autorandr/ CONFIG=~/.autorandr.conf @@ -113,8 +114,11 @@ setup_fp() { } current_cfg_xrandr() { - local PRIMARY_SETUP=$(xdpyinfo -ext XINERAMA|awk '/^ head #0:/ {printf $3 $5}') - $XRANDR -q | awk -v primary_setup=${PRIMARY_SETUP} ' + local PRIMARY_SETUP=""; + if [ -x "$XDPYINFO" ]; then + PRIMARY_SETUP="$($XDPYINFO -ext XINERAMA | awk '/^ head #0:/ {printf $3 $5}')" + fi + $XRANDR -q | awk -v primary_setup="${PRIMARY_SETUP}" ' # display is connected and has a mode /^[^ ]+ connected [^(]/ { split($3, A, "+");