Check-in [20acaed485]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:20acaed485addb0d0206800a678df5d8e990284a
Date: 2013-01-31 14:32:32
User: root
Comment:xrandrshell: xrandr may have more than one frequency on a line

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/quicksetup

@@ -45,10 +45,11 @@
 #120627 support kbd pkg.
 #120708 'quickarm' symlink to 'quicksetup', for booting on arm boards. see also /etc/rc.d/BOOTCONSTRAINED and /usr/sbin/delayedrun.
 #120714 revert 120708. instead, read BOOT_BOARD to determine type of board booting off. support raspberry pi audio settings.
 #120717 remove XPID=""
 #120901 /usr/share/zoneinfo layout has changed (ubuntu precise).
+#130131 xrandr may have more than one frequency on a line, ex:   1360x768       59.8     60.0
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}
 
 export TEXTDOMAIN=quicksetup
 export OUTPUT_CHARSET=UTF-8
@@ -753,11 +754,16 @@
    FLAG_XYRES="disabled"
   fi
 
   XRANDR="`xrandr -q`"
   DEF_XYRES="`echo "$XRANDR" | tr -s ' ' | grep '^ [0-9]' | grep '\*' | cut -f 2 -d ' '`"
-  LIST_XYRESES="`echo "$XRANDR" | tr -s ' ' | grep '^ [0-9]' | cut -f 2,3 -d ' ' | sed -e 's%$% "" off%'`"
+  #130131 xrandr may have more than one frequency on a line, ex:   1360x768       59.8     60.0
+  #LIST_XYRESES="`echo "$XRANDR" | tr -s ' ' | grep '^ [0-9]' | cut -f 2,3 -d ' ' | sed -e 's%$% "" off%'`"
+  #1301310 creates multiple lines, ex: "1360x768       59.8" and "1360x768       60.0"...
+  xXYRESES="$(echo "$XRANDR" | tr -s ' ' | grep '^ [0-9]' | cut -f 2,3,4 -d ' ' | sed -r -e 's%([^ ]*) ([^ ]*) ([^ ]*)%\1 \2TWO\1THREE\3%' -e 's%(TWO.*THREE$)%%' -e 's%TWO%\n%' -e 's%THREE% %')"
+  LIST_XYRESES=""
+  [ "$xXYRESES" ] && LIST_XYRESES="$(echo "$xXYRESES" | sed -e 's%$% "" off%')"
   echo "$LIST_XYRESES" > /var/local/quickset-xrandr-list
   onPTN="s%^${DEF_XYRES} \"(.*)\" off$%${DEF_XYRES} \"\1\" on%"
   sed -i -e 's% on$% off%' -r -e "$onPTN" /var/local/quickset-xrandr-list
 
   DEFAULTXML=""