#!/bin/bash source /etc/alx-config/config.rc default_xfreeconf(){ cat > /etc/X11/XF86Config << "EOF" Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "speedo" Load "freetype" # Load "xtt" # Load "glx" Load "dri" Load "vnc" EndSection Section "Files" RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/X11R6/lib/X11/fonts/local/" FontPath "/usr/X11R6/lib/X11/fonts/misc/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled" #prevents slow startup when disabled -> speedo, type1 #FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" #FontPath "/usr/X11R6/lib/X11/fonts/Type1/" FontPath "/usr/X11R6/lib/X11/fonts/TrueType/" FontPath "/usr/X11R6/lib/X11/fonts/freefont/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/" # The module search path. The default path is shown here. # ModulePath "/usr/X11R6/lib/modules" EndSection Section "ServerFlags" # ctrl+alt+fn disabled; dont't allow to switch consoles # Option "DontVTSwitch" # ctrl+alt+backspace disabled; don't restart the xserver # Option "DontZap" # ctrl+alt+[+]/[-] disabled; don't allow to change resolution # Option "Dont Zoom" EndSection Section "InputDevice" Identifier "Keyboard1" Driver "Keyboard" Option "AutoRepeat" "500 30" # Option "Xleds" "1 2 3" Option "XkbRules" "xfree86" Option "XkbModel" "pc104" Option "XkbLayout" "de" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "PS/2" Option "Device" "/dev/psaux" Option "Resolution" "1200" Option "ZAxisMapping" "4 5" EndSection #vnc Section "InputDevice" Identifier "vncKeyboard" Driver "rfbkeyb" EndSection Section "InputDevice" Identifier "vncMouse" Driver "rfbmouse" EndSection Section "Monitor" # Aamazing CM-1528-FS Identifier "mon0" HorizSync 28-64 VertRefresh 47-104 EndSection Section "Device" Identifier "vga0" Driver "vesa" #VideoRam 32768 # Insert Clocks lines here if appropriate # vnc options # By default, no password is required. # The next rfbauth uses the root password for vncserver Option "rfbauth" "/root/.vnc/passwd" Option "rfbport" "5900" # The use one of the next ...shared options ("nevershared" is the default) #Option "nevershared" Option "alwaysshared" Option "dontdisconnect" # To activate the http server Option "httpdir" "/usr/share/vnc/classes" Option "httpport" "5800" # For XEvents # The local user must accept the new connection. # An X application must be used to send the acceptance back to the server. # Using the extension library as detailed above. # Option "useraccept" # Enable the vnc service on this device, IMPORTANT!!!!!!!!!!!! Option "usevnc" # The options below are new in the 4.3.0 release # Only listen on the localhost interface # Option "localhost" # Listen on a specific interface # Option "interface" "192.168.0.1" # View only session # Option "viewonly" ### monitor settings lesen ### source $SETTINGS_TEMPLATE/system/monitor/monitor # The option below is new in the 4.3.0.4 release # Option "loginauth" EndSection Section "Screen" Identifier "Screen 1" Device "vga0" Monitor "mon0" DefaultDepth 16 Subsection "Display" Depth 8 Modes "1024x768" ViewPort 0 0 EndSubsection Subsection "Display" Depth 16 Modes "1024x768" ViewPort 0 0 EndSubsection Subsection "Display" Depth 24 Modes "1024x768" ViewPort 0 0 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" #vnc InputDevice "vncMouse" "ExtraPointer" InputDevice "vncKeyboard" "ExtraKeyboard" EndSection # Section "DRI" # Mode 0666 # EndSection EOF } setup_xfreeconf(){ mkdir -p $SETTINGS_TEMPLATE/system rm -rf $SETTINGS_TEMPLATE/system/vga rm -rf $SETTINGS_TEMPLATE/system/mouse rm -rf $SETTINGS_TEMPLATE/system/monitor cp -R $SETTINGS_TEMPLATE/menu/vga $SETTINGS_TEMPLATE/system cp -R $SETTINGS_TEMPLATE/menu/mouse $SETTINGS_TEMPLATE/system cp -R $SETTINGS_TEMPLATE/menu/monitor $SETTINGS_TEMPLATE/system MOUSEPROT="`cat $SETTINGS_TEMPLATE/system/mouse/mouse`" VGADRIV="`cat $SETTINGS_TEMPLATE/system/vga/vga`" vgadepth="`cat $SETTINGS_TEMPLATE/system/vga/vgadepth`" resolution="`cat $SETTINGS_TEMPLATE/system/vga/vgares`" ### monitor settings lesen ### source $SETTINGS_TEMPLATE/system/monitor/monitor if [ -z "${MOUSEPROT}" \ -o -z "${VGADRIV}" \ -o -z "${vgadepth}" \ -o -z "${resolution}" \ -o -z "${myvendor}" \ -o -z "${mymodel}" \ -o -z "${hsync}" \ -o -z "${vref}" ] then echo "Not all needed VARS are set" exit 1 fi [ -f /etc/X11/XF86Config ] && mv /etc/X11/XF86Config /etc/X11/XF86Config.old cat > /etc/X11/XF86Config << "EOF" Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "speedo" Load "freetype" # Load "xtt" # Load "glx" Load "dri" EOF if [ "${LOADVNC}" == "true" ] then echo ' Load "vnc"' >> /etc/X11/XF86Config fi cat >> /etc/X11/XF86Config << "EOF" EndSection Section "Files" RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/X11R6/lib/X11/fonts/local/" FontPath "/usr/X11R6/lib/X11/fonts/misc/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled" #prevents slow startup when disabled -> speedo, type1 #FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" #FontPath "/usr/X11R6/lib/X11/fonts/Type1/" FontPath "/usr/X11R6/lib/X11/fonts/TrueType/" FontPath "/usr/X11R6/lib/X11/fonts/freefont/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/" # The module search path. The default path is shown here. # ModulePath "/usr/X11R6/lib/modules" EndSection Section "ServerFlags" # ctrl+alt+fn disabled; dont't allow to switch consoles # Option "DontVTSwitch" # ctrl+alt+backspace disabled; don't restart the xserver # Option "DontZap" # ctrl+alt+[+]/[-] disabled; don't allow to change resolution # Option "Dont Zoom" EndSection Section "InputDevice" Identifier "Keyboard1" Driver "Keyboard" Option "AutoRepeat" "500 30" # Option "Xleds" "1 2 3" Option "XkbRules" "xfree86" Option "XkbModel" "pc104" Option "XkbLayout" "de" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" EOF case ${MOUSEPROT} in PS/2) echo ' Option "Protocol" "PS/2"' >> /etc/X11/XF86Config echo ' Option "Device" "/dev/psaux"' >> /etc/X11/XF86Config echo ' Option "Resolution" "1200"' >> /etc/X11/XF86Config ;; IMPS/2) echo ' Option "Protocol" "IMPS/2"' >> /etc/X11/XF86Config echo ' Option "Device" "/dev/psaux"' >> /etc/X11/XF86Config echo ' Option "Resolution" "1200"' >> /etc/X11/XF86Config echo ' Option "ZAxisMapping" "4 5"' >> /etc/X11/XF86Config ;; Auto) echo ' Option "Protocol" "Auto"' >> /etc/X11/XF86Config echo ' Option "Device" "/dev/ttys0"' >> /etc/X11/XF86Config echo ' Option "Resolution" "1200"' >> /etc/X11/XF86Config ;; esac cat >> /etc/X11/XF86Config << "EOF" EndSection EOF if [ "${LOADVNC}" == "true" ] then cat >> /etc/X11/XF86Config << "EOF" #vnc Section "InputDevice" Identifier "vncKeyboard" Driver "rfbkeyb" EndSection Section "InputDevice" Identifier "vncMouse" Driver "rfbmouse" EndSection EOF fi ##monitor setup echo 'Section "Monitor"' >> /etc/X11/XF86Config echo " # ${myvendor} ${mymodel}" >> /etc/X11/XF86Config echo ' Identifier "mon0"' >> /etc/X11/XF86Config echo " HorizSync ${hsync}" >> /etc/X11/XF86Config echo " VertRefresh ${vref}" >> /etc/X11/XF86Config cat >> /etc/X11/XF86Config << "EOF" EndSection Section "Device" Identifier "vga0" Driver "vesa" #VideoRam 32768 # Insert Clocks lines here if appropriate EOF if [ "${LOADVNC}" == "true" ] then cat >> /etc/X11/XF86Config << "EOF" # vnc options # By default, no password is required. # The next rfbauth uses the root password for vncserver Option "rfbauth" "/root/.vnc/passwd" Option "rfbport" "5900" # The use one of the next ...shared options ("nevershared" is the default) #Option "nevershared" Option "alwaysshared" Option "dontdisconnect" # To activate the http server Option "httpdir" "/usr/share/vnc/classes" Option "httpport" "5800" # For XEvents # The local user must accept the new connection. # An X application must be used to send the acceptance back to the server. # Using the extension library as detailed above. # Option "useraccept" # Enable the vnc service on this device, IMPORTANT!!!!!!!!!!!! Option "usevnc" # The options below are new in the 4.3.0 release # Only listen on the localhost interface # Option "localhost" # Listen on a specific interface # Option "interface" "192.168.0.1" # View only session # Option "viewonly" # The option below is new in the 4.3.0.4 release # Option "loginauth" EOF fi cat >> /etc/X11/XF86Config << "EOF" EndSection Section "Screen" Identifier "Screen 1" Device "vga0" Monitor "mon0" EOF echo " DefaultDepth ${vgadepth}" >> /etc/X11/XF86Config echo ' Subsection "Display"' >> /etc/X11/XF86Config echo " Depth ${vgadepth}" >> /etc/X11/XF86Config echo " Modes \"${resolution}\"" >> /etc/X11/XF86Config echo ' ViewPort 0 0' >> /etc/X11/XF86Config echo ' EndSubsection' >> /etc/X11/XF86Config cat >> /etc/X11/XF86Config << "EOF" EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" EOF if [ "${LOADVNC}" == "true" ] then cat >> /etc/X11/XF86Config << "EOF" #vnc InputDevice "vncMouse" "ExtraPointer" InputDevice "vncKeyboard" "ExtraKeyboard" EOF fi cat >> /etc/X11/XF86Config << "EOF" EndSection # Section "DRI" # Mode 0666 # EndSection EOF } setup_xfreeconf