# HG changeset patch # User Christophe Lincoln # Date 1240840641 -7200 # Node ID 31cdb39904933201be4080b258a8f04139ebcdc2 # Parent 052f4f60ee36a9466cb68023875b037467f80b38 hwconf.sh: Add screen=auto option to autodetect screen resolution diff -r 052f4f60ee36 -r 31cdb3990493 etc/init.d/hwconf.sh --- a/etc/init.d/hwconf.sh Mon Apr 27 15:48:38 2009 +0200 +++ b/etc/init.d/hwconf.sh Mon Apr 27 15:57:21 2009 +0200 @@ -72,16 +72,25 @@ sed -i "s|-screen|$XARG -screen|" /etc/slim.conf fi if [ -n "$SCREEN" ]; then - export NEW_SCREEN=$SCREEN - if [ "$NEW_SCREEN" = "text" ]; then - echo -n "Disabling X login manager: slim..." - . /etc/rcS.conf - RUN_DAEMONS=`echo $RUN_DAEMONS | sed s/' slim'/''/` - sed -i s/"RUN_DAEMONS.*"/"RUN_DAEMONS=\"$RUN_DAEMONS\"/" /etc/rcS.conf - status - else - tazx `cat /etc/X11/wm.default` - fi + case "$SCREEN" in + text) + # Disable X. + echo -n "Disabling X login manager: slim..." + . /etc/rcS.conf + RUN_DAEMONS=`echo $RUN_DAEMONS | sed s/' slim'/''/` + sed -i s/"RUN_DAEMONS.*"/"RUN_DAEMONS=\"$RUN_DAEMONS\"/" /etc/rcS.conf + status ;; + auto) + # Auto detect screen resolution. + export NEW_SCREEN=`Xvesa -listmodes 2>&1 | grep ^0x | \ + awk '{ printf "%s %s\n",$2 }' \ + | sort -nr | grep x[1-2][4-6] | head -n 1` + tazx `cat /etc/X11/wm.default` ;; + *) + # Use specified screen resolution. + export NEW_SCREEN=$SCREEN + tazx `cat /etc/X11/wm.default` ;; + esac else tazx `cat /etc/X11/wm.default` fi