# $Id$ # configures the x11 server on the host via mysql db settings 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 from the db evaluate_table cfg_graphic evaluate_table cfg_input # 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 \"${cfg_graphic_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}" "${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 ]] 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 ${cfg_graphic_depth}" addconfig ' SubSection "Display"' addconfig " Depth ${cfg_graphic_depth}" addconfig " Modes \"${cfg_graphic_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' }