--- alx-src/branches/alxconf_20060908/functions/config_x11.sh 2010/11/23 12:24:14 1582 +++ alx-src/branches/alxconf_20060908/functions/config_x11.sh 2011/01/25 00:32:15 1710 @@ -30,15 +30,32 @@ 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 local HAS_REALVNC + local HAS_TIGERVNC # xfree or xorg ? xserver="$(readlink /usr/X11R6/bin/X)" @@ -64,6 +81,13 @@ HAS_REALVNC="no" fi + 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}"Using '${xserver}' as x11-server " @@ -74,6 +98,9 @@ elif [[ ${HAS_REALVNC} = yes ]] then echo "with realvnc enabled ..." + elif [[ ${HAS_TIGERVNC} = yes ]] + then + echo "with tigervnc enabled ..." else echo "..." fi @@ -95,6 +122,7 @@ [[ ${HAS_VNC} = yes ]] && echo ' Load "vnc"' >> ${xfconfig} [[ ${HAS_REALVNC} = yes ]] && echo ' Load "vnc"' >> ${xfconfig} + [[ ${HAS_TIGERVNC} = yes ]] && echo ' Load "vnc"' >> ${xfconfig} echo 'EndSection' >> ${xfconfig} @@ -104,14 +132,15 @@ case ${xserver} in Xorg) - echo ' FontPath "/usr/share/fonts/local/"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/misc/"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} - echo ' FontPath "/usr/share/fonts/100dpi/"' >> ${xfconfig} + # only add existing font pathes + [[ -f /usr/share/fonts/local/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/local/"' >> ${xfconfig} + [[ -f /usr/share/fonts/misc/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/misc/"' >> ${xfconfig} + [[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig} + [[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig} + [[ -f /usr/share/fonts/TrueType/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} + [[ -f /usr/share/fonts/freefont/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} + [[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} + [[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/100dpi/"' >> ${xfconfig} ;; XFree86) echo ' FontPath "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig} @@ -194,21 +223,48 @@ fi # monitor + echo '' >> ${xfconfig} 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) + if [[ -x /sbin/ddcxinfo-knoppix ]] + then + echo '' >> ${xfconfig} + ddcxinfo-knoppix -modelines >> ${xfconfig} + fi echo 'EndSection' >> ${xfconfig} # vga echo '' >> ${xfconfig} echo 'Section "Device"' >> ${xfconfig} echo ' Identifier "vga0"' >> ${xfconfig} + # check for openchrome and use it if available + if [[ ${ALX_MODULE} = via ]] && [ -f /usr/X11R6/lib/xorg/modules/drivers/openchrome_drv.so ] + then + ALX_MODULE="openchrome" + fi echo " Driver \"${ALX_MODULE}\"" >> ${xfconfig} # vnc server options @@ -247,7 +303,7 @@ echo ' ViewPort 0 0' >> ${xfconfig} echo ' EndSubsection' >> ${xfconfig} - if [[ ${HAS_REALVNC} = yes ]] + if [[ ${HAS_REALVNC} = yes ]] || [[ ${HAS_TIGERVNC} = yes ]] then echo ' Option "SecurityTypes" "VncAuth"' >> ${xfconfig} echo ' Option "UserPasswdVerifier" "VncAuth"' >> ${xfconfig}