]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
optionally use xdpyinfo
authorStefan Tomanek <stefan.tomanek@wertarbyte.de>
Sun, 12 Feb 2012 22:10:54 +0000 (23:10 +0100)
committerStefan Tomanek <stefan.tomanek@wertarbyte.de>
Sun, 12 Feb 2012 22:10:54 +0000 (23:10 +0100)
autorandr

index 376b1aeaadeb1dc96f8eed382793181eab1fba70..03333f92cc9694049a110f95f97eb2c7348e1cbd 100755 (executable)
--- 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, "+");