--- alx-src/branches/alxconf_20060908/functions/config_x11.sh 2010/12/28 12:45:46 1641 +++ alx-src/branches/alxconf-060/functions/config_x11.sh 2011/04/14 19:29:35 1800 @@ -27,14 +27,31 @@ # which input devices are we using ? ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'") + ALX_MOUSE_RESOLUTION=$(mysqldo "select mouse_resolution 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 + + # setup xession + sed -i "s:\(^GLOGIN=\).*:\1slim:" /etc/rc.config + + # windowmanager + echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc +} + config_x11() { # get our settings from the db get_x11_settings + # setup displaymanager + config_display_manager + local xserver local xfconfig local HAS_VNC @@ -184,7 +201,9 @@ *) device=/dev/mouse;; esac echo " Option \"Device\" \"${device}\"" >> ${xfconfig} - echo ' Option "Resolution" "1200"' >> ${xfconfig} + + [[ -z ${ALX_MOUSE_RESOLUTION} ]] && ALX_MOUSE_RESOLUTION="1200" + echo " Option \"Resolution\" \"${ALX_MOUSE_RESOLUTION}\"" >> ${xfconfig} [[ ${ALX_MOUSE} = IMPS/2 ]] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} @@ -211,14 +230,33 @@ echo 'Section "Monitor"' >> ${xfconfig} echo ' Identifier "Monitor0"' >> ${xfconfig} echo ' Option "DPMS"' >> ${xfconfig} - echo '' >> ${xfconfig} + + # 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" + + echo '' >> ${xfconfig} + echo " HorizSync ${hsync}" >> ${xfconfig} + echo " VertRefresh ${vsync}" >> ${xfconfig} + fi + # add cvt modelines + echo '' >> ${xfconfig} 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:_.*\":\":') echo "${modeline}" >> ${xfconfig} # add ddcxinfo-knoppix modelines (fallback) - [[ -x /sbin/ddcxinfo-knoppix ]] && ddcxinfo-knoppix -modelines >> ${xfconfig} + if [[ -x /sbin/ddcxinfo-knoppix ]] + then + echo '' >> ${xfconfig} + ddcxinfo-knoppix -modelines >> ${xfconfig} + fi echo 'EndSection' >> ${xfconfig} # vga