[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] determine resolution with xdpyinfo instead of xrandr



On 02/23/2010 11:28 AM, Ronny Standtke wrote:
I have seen xrandr fail on some systems (e.g. Asus K401J) with the following
error message:

xrandr: Output Unknown-2 is not disconnected but has no modes

can you reproduce this with squeeze and sid?

+#################################################################
+# xrandr failed on Asus K401J with error message:               #
+# xrandr: Output Unknown-2 is not disconnected but has no modes #
+# therefore we use now xdpyinfo (see below)                     #
+#################################################################

doesn't belong into the code, but into the commit message.

+#_RESOLUTION="$(xrandr)"
+#
+#read x x x x x x x _RESOLUTION_X x _RESOLUTION_Y x << EOF
+#${_RESOLUTION}
+#EOF
+#
+#_RESOLUTION_Y="${_RESOLUTION_Y%,}"

rather than commenting out, you want to replace things.

-read x x x x x x x _RESOLUTION_X x _RESOLUTION_Y x << EOF
-${_RESOLUTION}
-EOF
-
-_RESOLUTION_Y="${_RESOLUTION_Y%,}"
+#################################################################
+# this version with with xdpyinfo seems to be more reliable     #
+#################################################################

same as above.

+eval $(LC_ALL=C; xdpyinfo | grep dimensions | awk '{print $2}' | awk -Fx '{print "_RESOLUTION_X=" $1 " _RESOLUTION_Y=" $2}')

useless use of grep (awk has grep built-in with //). you might want to trim some other things too, and add a depends to the package containing xdpyinfo.

--
Address:        Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email:          daniel.baumann@panthera-systems.net
Internet:       http://people.panthera-systems.net/~daniel-baumann/


Reply to: