Magellan Linux

Diff of /alx-src/trunk/tinyalxconfig-ng/functions/config_x11.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 386 by niro, Wed Jun 4 16:47:56 2008 UTC revision 517 by niro, Sun Jun 22 22:20:28 2008 UTC
# Line 1  Line 1 
1  # $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/functions/config_x11.sh,v 1.1 2008-06-04 16:47:56 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/functions/config_x11.sh,v 1.8 2008-06-22 22:20:28 niro Exp $
2  # configures the x11 server on the host via mysql db settings  # configures the x11 server on the host via mysql db settings
3    
4  get_x11_settings()  get_x11_settings()
5  {  {
6   local x i all DB_X11SETTINGS   local x i all DB_X11SETTINGS
7    
8   # autodetect or not ?   # autodetect or not ?
9   if [ $(mysqldo "select monitorid from cfg_graphic where serial='${ALX_SERIAL}'") -gt 0 ]   if [ $(mysqldo "select monitorid from cfg_graphic where serial='${ALX_SERIAL}'") -gt 0 ]
10   then   then
# Line 77  config_x11() Line 77  config_x11()
77  {  {
78   # get our settings from the db   # get our settings from the db
79   get_x11_settings   get_x11_settings
80    
81   local xserver   local xserver
82   local xfconfig   local xfconfig
83   local HAS_VNC   local startx
84   local HAS_REALVNC   local HAS_REALVNC=no
85    
86   # xfree or xorg ?   # xfree or xorg ?
87   xserver="$(readlink /usr/X11R6/bin/X)"   xserver="Xorg"
88     # todo: maybe kdrive support?
89   case ${xserver} in   case ${xserver} in
90   Xorg)   Xorg) xfconfig=/etc/X11/xorg.conf; startx=startx-xorg ;;
  xfconfig=/etc/X11/xorg.conf  
  ;;  
  XFree86)  
  xfconfig=/etc/X11/XF86Config  
  ;;  
  *)  
  echo "    Unkown xserver. aborting."  
  exit 1  
  ;;  
91   esac   esac
92    
93   # got we vnc support ?   [ -f /usr/lib/modules/extensions/vnc.so ] && HAS_REALVNC="yes"
  if [ -f /usr/X11R6/lib/modules/vnc.so ]  
  then  
  HAS_VNC="yes"  
  else  
  HAS_VNC="no"  
  fi  
   
  if [ -f /usr/X11R6/lib/modules/extensions/vnc.so ]  
  then  
  HAS_REALVNC="yes"  
  else  
  HAS_REALVNC="no"  
  fi  
94    
95   # show which server we use   # show which server we use
96   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "
97    
98   # show if we have vnc   # show if we have vnc
99   if [[ ${HAS_VNC} = yes ]]   if [[ ${HAS_REALVNC} = yes ]]
  then  
  echo "with vnc enabled ..."  
  elif [[ ${HAS_REALVNC} = yes ]]  
100   then   then
101   echo "with realvnc enabled ..."   echo "with realvnc enabled ..."
102   else   else
# Line 146  config_x11() Line 121  config_x11()
121   echo '#    Load       "glx"' >> ${xfconfig}   echo '#    Load       "glx"' >> ${xfconfig}
122   echo '    Load       "dri"' >> ${xfconfig}   echo '    Load       "dri"' >> ${xfconfig}
123    
  [[ ${HAS_VNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}  
124   [[ ${HAS_REALVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}   [[ ${HAS_REALVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}
125    
126   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
# Line 154  config_x11() Line 128  config_x11()
128   # fonts   # fonts
129   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
130   echo 'Section "Files"' >> ${xfconfig}   echo 'Section "Files"' >> ${xfconfig}
131   echo '    RgbPath "/usr/X11R6/lib/X11/rgb"' >> ${xfconfig}   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}
132     echo '    FontPath   "/usr/share/fonts/misc/"' >> ${xfconfig}
133   case ${xserver} in   echo '    FontPath   "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig}
134   Xorg)   echo '    FontPath   "/usr/share/fonts/75dpi/"' >> ${xfconfig}
135   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}   # not provided by tinyALX
136   echo '    FontPath   "/usr/share/fonts/misc/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig}
137   echo '    FontPath   "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig}   #echo '    #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig}
138   echo '    FontPath   "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig}   #echo '    #FontPath   "/usr/share/fonts/Speedo/"' >> ${xfconfig}
139   echo '    #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig}   #echo '    #FontPath   "/usr/share/fonts/Type1/"' >> ${xfconfig}
140   echo '    #FontPath   "/usr/share/fonts/Speedo/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/TrueType/"' >> ${xfconfig}
141   echo '    #FontPath   "/usr/share/fonts/Type1/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/freefont/"' >> ${xfconfig}
142   echo '    FontPath   "/usr/share/fonts/TrueType/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/100dpi/"' >> ${xfconfig}
  echo '    FontPath   "/usr/share/fonts/freefont/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/share/fonts/75dpi/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/share/fonts/100dpi/"' >> ${xfconfig}  
  ;;  
  XFree86)  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"' >> ${xfconfig}  
  echo '    #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig}  
  echo '    #FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"' >> ${xfconfig}  
  echo '    #FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/TrueType/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/freefont/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"' >> ${xfconfig}  
  echo '    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"' >> ${xfconfig}  
  ;;  
  esac  
   
  echo '#    ModulePath "/usr/X11R6/lib/modules"' >> ${xfconfig}  
143   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
144    
145   # server flags   # server flags
# Line 200  config_x11() Line 154  config_x11()
154   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
155   echo 'Section "InputDevice"' >> ${xfconfig}   echo 'Section "InputDevice"' >> ${xfconfig}
156   echo '    Identifier "Keyboard1"' >> ${xfconfig}   echo '    Identifier "Keyboard1"' >> ${xfconfig}
157     echo '    Driver "kbd"' >> ${xfconfig}
  case ${xserver} in  
  Xorg)  
  echo '    Driver "kbd"' >> ${xfconfig}  
  ;;  
  XFree86)  
  echo '    Driver "Keyboard"' >> ${xfconfig}  
  ;;  
  esac  
   
158   echo '    Option "AutoRepeat" "500 30"' >> ${xfconfig}   echo '    Option "AutoRepeat" "500 30"' >> ${xfconfig}
159   echo '#    Option "Xleds"      "1 2 3"' >> ${xfconfig}   echo '#    Option "Xleds"      "1 2 3"' >> ${xfconfig}
160     echo '    Option "XkbRules" "xorg"' >> ${xfconfig}
  case ${xserver} in  
  Xorg)  
  echo '    Option "XkbRules" "xorg"' >> ${xfconfig}  
  ;;  
  XFree86)  
  echo '    Option "XkbRules" "xfree86"' >> ${xfconfig}  
  ;;  
  esac  
   
161   echo '    Option "XkbModel" "pc105"' >> ${xfconfig}   echo '    Option "XkbModel" "pc105"' >> ${xfconfig}
162   echo '    Option "XkbLayout" "de"' >> ${xfconfig}   echo '    Option "XkbLayout" "de"' >> ${xfconfig}
163   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
# Line 235  config_x11() Line 171  config_x11()
171    
172   local device   local device
173   case ${ALX_MOUSE} in   case ${ALX_MOUSE} in
174   IMPS/2|PS/2) device=/dev/psaux;;   IMPS/2|PS/2) device=/dev/input/mice;;
175   Auto) device=/dev/mouse;;   Auto) device=/dev/mouse;;
176   *) device=/dev/mouse;;   *) device=/dev/mouse;;
177   esac   esac
# Line 246  config_x11() Line 182  config_x11()
182    
183   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
184    
  # vnc keyboard && mouse  
  if [[ ${HAS_VNC} = yes ]]  
  then  
  echo '' >> ${xfconfig}  
  echo 'Section "InputDevice"' >> ${xfconfig}  
  echo '    Identifier "vncKeyboard"' >> ${xfconfig}  
  echo '    Driver "rfbkeyb"' >> ${xfconfig}  
  echo 'EndSection' >> ${xfconfig}  
   
  echo '' >> ${xfconfig}  
  echo 'Section "InputDevice"' >> ${xfconfig}  
  echo '    Identifier "vncMouse"' >> ${xfconfig}  
  echo '    Driver "rfbmouse"' >> ${xfconfig}  
  echo 'EndSection' >> ${xfconfig}  
  fi  
   
185   # monitor   # monitor
186   if [ -x "/sbin/ddcxinfo-knoppix" ] &&   echo '' >> ${xfconfig}
187     if [ -x /sbin/ddcxinfo-knoppix ] &&
188     [[ ${ALX_HSYNC} = auto ]] ||     [[ ${ALX_HSYNC} = auto ]] ||
189     [[ ${ALX_VREF} = auto ]]     [[ ${ALX_VREF} = auto ]]
190   then   then
191   ddcxinfo-knoppix -monitor >> ${xfconfig}   ddcxinfo-knoppix -monitor >> ${xfconfig}
192   else   else
  echo '' >> ${xfconfig}  
193   echo "# Monitor: ${ALX_VENDOR} ${ALX_MODEL}" >> ${xfconfig}   echo "# Monitor: ${ALX_VENDOR} ${ALX_MODEL}" >> ${xfconfig}
194   echo 'Section "Monitor"' >> ${xfconfig}   echo 'Section "Monitor"' >> ${xfconfig}
195   echo '    Identifier  "Monitor0"' >> ${xfconfig}   echo '    Identifier  "Monitor0"' >> ${xfconfig}
# Line 284  config_x11() Line 204  config_x11()
204   echo 'Section "Device"' >> ${xfconfig}   echo 'Section "Device"' >> ${xfconfig}
205   echo '    Identifier  "vga0"' >> ${xfconfig}   echo '    Identifier  "vga0"' >> ${xfconfig}
206   echo "    Driver      \"${ALX_MODULE}\"" >> ${xfconfig}   echo "    Driver      \"${ALX_MODULE}\"" >> ${xfconfig}
   
  # vnc server options  
  if [[ ${HAS_VNC} = yes ]]  
  then  
  echo '' >> ${xfconfig}  
  echo '    # rfb options' >> ${xfconfig}  
  echo '    Option "rfbauth"     "/root/.vnc/passwd"' >> ${xfconfig}  
  echo '    Option "rfbport"     "5900"' >> ${xfconfig}  
  echo '    #Option "nevershared"' >> ${xfconfig}  
  echo '    Option "alwaysshared"' >> ${xfconfig}  
  echo '    Option "dontdisconnect"' >> ${xfconfig}  
  echo '    Option "httpdir"     "/usr/share/vnc/classes"' >> ${xfconfig}  
  echo '    Option "httpport"    "5800"' >> ${xfconfig}  
  echo '    # Option "useraccept"' >> ${xfconfig}  
  echo '    Option "usevnc"' >> ${xfconfig}  
  echo '    # Option "localhost"' >> ${xfconfig}  
  echo '    # Option "interface" "192.168.0.1"' >> ${xfconfig}  
  echo '    # Option "viewonly"' >> ${xfconfig}  
  echo '    # Option "loginauth"' >> ${xfconfig}  
  echo '' >> ${xfconfig}  
  fi  
   
207   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
208    
209   # screens   # screens
# Line 336  config_x11() Line 234  config_x11()
234   echo '    Screen "Screen 1"' >> ${xfconfig}   echo '    Screen "Screen 1"' >> ${xfconfig}
235   echo '    InputDevice "Mouse1" "CorePointer"' >> ${xfconfig}   echo '    InputDevice "Mouse1" "CorePointer"' >> ${xfconfig}
236   echo '    InputDevice "Keyboard1" "CoreKeyboard"' >> ${xfconfig}   echo '    InputDevice "Keyboard1" "CoreKeyboard"' >> ${xfconfig}
   
  # load vnc keyboard && mouse  
  if [[ ${HAS_VNC} = yes ]]  
  then  
  echo '    InputDevice "vncMouse"    "ExtraPointer"' >> ${xfconfig}  
  echo '    InputDevice "vncKeyboard" "ExtraKeyboard"' >> ${xfconfig}  
  fi  
   
237   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
238    
239   # dri (here disabled, use default of xserver)   # dri (here disabled, use default of xserver)
# Line 352  config_x11() Line 242  config_x11()
242   echo '#    Mode 0666' >> ${xfconfig}   echo '#    Mode 0666' >> ${xfconfig}
243   echo '# EndSection' >> ${xfconfig}   echo '# EndSection' >> ${xfconfig}
244    
245     install -d ${SETTINGSPATH}
246   echo "ALX_MOUSE_ACCELERATION=\"${ALX_MOUSE_ACCELERATION}\"" > ${SETTINGSPATH}/mouse   echo "ALX_MOUSE_ACCELERATION=\"${ALX_MOUSE_ACCELERATION}\"" > ${SETTINGSPATH}/mouse
247   echo "ALX_MOUSE_THRESHOLD=\"${ALX_MOUSE_THRESHOLD}\"" >> ${SETTINGSPATH}/mouse   echo "ALX_MOUSE_THRESHOLD=\"${ALX_MOUSE_THRESHOLD}\"" >> ${SETTINGSPATH}/mouse
 }  
248    
249     # setup startx
250     ln -snf ${xserver} /usr/bin/X
251     ln -snf ${startx} /usr/bin/startx
252    }

Legend:
Removed from v.386  
changed lines
  Added in v.517