# $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 cat ${ALX_SKELETONS}/slim/slim.conf > /etc/slim.conf sed -i "s:@@USERNAME@@:${ALX_UNPRIV_USER}:" /etc/slim.conf # windowmanager echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc } config_x11() { local has_tigervnc local CONFIG # get our settings f2rom the db get_x11_settings # setup displaymanager config_display_manager # got we vnc support ? if [ -f /usr/X11R6/lib/xorg/modules/extensions/libvnc.so ] then has_tigervnc="yes" else has_tigervnc="no" fi # show which server we use echo -en ${COLOREDSTAR}"Configuring Xorg x11-server " # show if we have vnc if [[ ${has_tigervnc} = yes ]] then echo "with tigervnc enabled ..." else echo "..." fi # set_input_keyboard CONFIG="/etc/X11/xorg.conf.d/25-layout.conf" clearconfig addconfig 'Section "InputClass"' addconfig ' Identifier "keyboard layout"' addconfig ' MatchIsKeyboard "on"' addconfig ' Option "XkbLayout" "de"' addconfig 'EndSection' # graphic driver CONFIG="/etc/X11/xorg.conf.d/25-device.conf" clearconfig addconfig 'Section "Device"' addconfig ' Identifier "Card0"' addconfig " Driver \"${ALX_MODULE}\"" addconfig 'EndSection' # vnc module if [[ ${has_tigervnc} = yes ]] then CONFIG="/etc/X11/xorg.conf.d/25-module.conf" clearconfig addconfig 'Section "Module"' addconfig ' Load vnc' addconfig 'EndSection' fi # monitor CONFIG="/etc/X11/xorg.conf.d/25-monitor.conf" clearconfig addconfig 'Section "Monitor"' addconfig ' Identifier "Monitor0"' addconfig ' Option "DPMS"' # add hsync, vrefresh if [[ -x /sbin/ddcxinfo-knoppix ]] then local hsync="$(ddcxinfo-knoppix -hsync)" local vsync="$(ddcxinfo-knoppix -vsync)" # fallback [[ ${hsync} = 0-0 ]] && hsync="28-96" [[ ${vsync} = 0-0 ]] && vsync="50-60" addconfig addconfig " HorizSync ${hsync}" addconfig " VertRefresh ${vsync}" fi # add cvt modelines 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:_.*\":\":') addconfig "${modeline}" # add ddcxinfo-knoppix modelines (fallback) if [[ -x /sbin/ddcxinfo-knoppix ]] then addconfig addconfig $(ddcxinfo-knoppix -modelines) fi addconfig 'EndSection' # screen CONFIG="/etc/X11/xorg.conf.d/25-screen.conf" clearconfig addconfig 'Section "Screen"' addconfig ' Identifier "Screen0"' addconfig ' Monitor "Monitor0"' addconfig " DefaultDepth ${ALX_DEPTH}" addconfig ' SubSection "Display"' addconfig " Depth ${ALX_DEPTH}" addconfig " Modes \"${ALX_RESOLUTION}\"" addconfig ' ViewPort 0 0' addconfig ' EndSubSection' # vnc auth if [[ ${has_tigervnc} = yes ]] then addconfig ' Option "SecurityTypes" "VncAuth"' addconfig ' Option "UserPasswdVerifier" "VncAuth"' addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' fi addconfig 'EndSection' }