--- alx-src/branches/alxconf-060/functions/config_x11.sh 2011/05/11 09:14:50 2037 +++ alx-src/branches/alxconf-060/functions/config_x11.sh 2011/05/17 11:46:16 2148 @@ -1,35 +1,6 @@ # $Id$ # configures the x11 server on the host via mysql db settings -get_x11_settings() -{ - local x i all DB_X11SETTINGS - # autodetect - all=$(mysqldo "select module, - resolution, - depth, - refresh_rate - from cfg_graphic where serial='${ALX_SERIAL}'") - - # split'em up and put 'em in an array - declare -i i=0 - for x in ${all} - do - DB_X11SETTINGS[${i}]="${x}" - ((i++)) - done - - # and now put them in usable var names and export them systemwide - export ALX_MODULE="${DB_X11SETTINGS[0]:=NULL}" - export ALX_RESOLUTION="${DB_X11SETTINGS[1]:=NULL}" - export ALX_DEPTH="${DB_X11SETTINGS[2]:=NULL}" - export ALX_REFRESH_RATE="${DB_X11SETTINGS[3]:=NULL}" - - # which input devices are we using ? - ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'") - export ALX_MOUSE -} - config_display_manager() { # setup slim @@ -45,8 +16,9 @@ local has_tigervnc local CONFIG - # get our settings f2rom the db - get_x11_settings + # get our settings from the db + evaluate_table cfg_graphic + evaluate_table cfg_input # setup displaymanager config_display_manager @@ -84,7 +56,7 @@ clearconfig addconfig 'Section "Device"' addconfig ' Identifier "Card0"' - addconfig " Driver \"${ALX_MODULE}\"" + addconfig " Driver \"${cfg_graphic_module}\"" addconfig 'EndSection' # vnc module @@ -122,7 +94,7 @@ addconfig local cvt="/usr/X11R6/bin/cvt" local modeline - modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') + modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') addconfig "${modeline}" # add ddcxinfo-knoppix modelines (fallback) if [[ -x /sbin/ddcxinfo-knoppix ]] @@ -138,10 +110,10 @@ addconfig 'Section "Screen"' addconfig ' Identifier "Screen0"' addconfig ' Monitor "Monitor0"' - addconfig " DefaultDepth ${ALX_DEPTH}" + addconfig " DefaultDepth ${cfg_graphic_depth}" addconfig ' SubSection "Display"' - addconfig " Depth ${ALX_DEPTH}" - addconfig " Modes \"${ALX_RESOLUTION}\"" + addconfig " Depth ${cfg_graphic_depth}" + addconfig " Modes \"${cfg_graphic_resolution}\"" addconfig ' ViewPort 0 0' addconfig ' EndSubSection' # vnc auth @@ -152,5 +124,4 @@ addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' fi addconfig 'EndSection' - }