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 399 by niro, Wed Jun 4 18:49:10 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.2 2008-06-04 18:49:10 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()
# Line 80  config_x11() Line 80  config_x11()
80    
81   local xserver   local xserver
82   local xfconfig   local xfconfig
83   local HAS_VNC   local HAS_REALVNC=no
  local HAS_REALVNC  
84    
85   # xfree or xorg ?   # xfree or xorg ?
86   xserver="$(readlink /usr/X11R6/bin/X)"   xserver="Xorg"
87     # todo: maybe kdrive support?
88   case ${xserver} in   case ${xserver} in
89   Xorg)   Xorg) xfconfig=/etc/X11/xorg.conf ;;
  xfconfig=/etc/X11/xorg.conf  
  ;;  
  XFree86)  
  xfconfig=/etc/X11/XF86Config  
  ;;  
  *)  
  echo "    Unkown xserver. aborting."  
  exit 1  
  ;;  
90   esac   esac
91    
92   # 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  
93    
94   # show which server we use   # show which server we use
95   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "
96    
97   # show if we have vnc   # show if we have vnc
98   if [[ ${HAS_VNC} = yes ]]   if [[ ${HAS_REALVNC} = yes ]]
  then  
  echo "with vnc enabled ..."  
  elif [[ ${HAS_REALVNC} = yes ]]  
99   then   then
100   echo "with realvnc enabled ..."   echo "with realvnc enabled ..."
101   else   else
# Line 146  config_x11() Line 120  config_x11()
120   echo '#    Load       "glx"' >> ${xfconfig}   echo '#    Load       "glx"' >> ${xfconfig}
121   echo '    Load       "dri"' >> ${xfconfig}   echo '    Load       "dri"' >> ${xfconfig}
122    
  [[ ${HAS_VNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}  
123   [[ ${HAS_REALVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}   [[ ${HAS_REALVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}
124    
125   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
# Line 154  config_x11() Line 127  config_x11()
127   # fonts   # fonts
128   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
129   echo 'Section "Files"' >> ${xfconfig}   echo 'Section "Files"' >> ${xfconfig}
130   echo '    RgbPath "/usr/X11R6/lib/X11/rgb"' >> ${xfconfig}   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}
131     echo '    FontPath   "/usr/share/fonts/misc/"' >> ${xfconfig}
132   case ${xserver} in   echo '    FontPath   "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig}
133   Xorg)   echo '    FontPath   "/usr/share/fonts/75dpi/"' >> ${xfconfig}
134   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}   # not provided by tinyALX
135   echo '    FontPath   "/usr/share/fonts/misc/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig}
136   echo '    FontPath   "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig}   #echo '    #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig}
137   echo '    FontPath   "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig}   #echo '    #FontPath   "/usr/share/fonts/Speedo/"' >> ${xfconfig}
138   echo '    #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig}   #echo '    #FontPath   "/usr/share/fonts/Type1/"' >> ${xfconfig}
139   echo '    #FontPath   "/usr/share/fonts/Speedo/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/TrueType/"' >> ${xfconfig}
140   echo '    #FontPath   "/usr/share/fonts/Type1/"' >> ${xfconfig}   #echo '    FontPath   "/usr/share/fonts/freefont/"' >> ${xfconfig}
141   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}  
142   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
143    
144   # server flags   # server flags
# Line 200  config_x11() Line 153  config_x11()
153   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
154   echo 'Section "InputDevice"' >> ${xfconfig}   echo 'Section "InputDevice"' >> ${xfconfig}
155   echo '    Identifier "Keyboard1"' >> ${xfconfig}   echo '    Identifier "Keyboard1"' >> ${xfconfig}
156     echo '    Driver "kbd"' >> ${xfconfig}
  case ${xserver} in  
  Xorg)  
  echo '    Driver "kbd"' >> ${xfconfig}  
  ;;  
  XFree86)  
  echo '    Driver "Keyboard"' >> ${xfconfig}  
  ;;  
  esac  
   
157   echo '    Option "AutoRepeat" "500 30"' >> ${xfconfig}   echo '    Option "AutoRepeat" "500 30"' >> ${xfconfig}
158   echo '#    Option "Xleds"      "1 2 3"' >> ${xfconfig}   echo '#    Option "Xleds"      "1 2 3"' >> ${xfconfig}
159     echo '    Option "XkbRules" "xorg"' >> ${xfconfig}
  case ${xserver} in  
  Xorg)  
  echo '    Option "XkbRules" "xorg"' >> ${xfconfig}  
  ;;  
  XFree86)  
  echo '    Option "XkbRules" "xfree86"' >> ${xfconfig}  
  ;;  
  esac  
   
160   echo '    Option "XkbModel" "pc105"' >> ${xfconfig}   echo '    Option "XkbModel" "pc105"' >> ${xfconfig}
161   echo '    Option "XkbLayout" "de"' >> ${xfconfig}   echo '    Option "XkbLayout" "de"' >> ${xfconfig}
162   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
# Line 235  config_x11() Line 170  config_x11()
170    
171   local device   local device
172   case ${ALX_MOUSE} in   case ${ALX_MOUSE} in
173   IMPS/2|PS/2) device=/dev/psaux;;   IMPS/2|PS/2) device=/dev/input/mice;;
174   Auto) device=/dev/mouse;;   Auto) device=/dev/mouse;;
175   *) device=/dev/mouse;;   *) device=/dev/mouse;;
176   esac   esac
# Line 246  config_x11() Line 181  config_x11()
181    
182   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
183    
  # 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  
   
184   # monitor   # monitor
185   if [ -x "/sbin/ddcxinfo-knoppix" ] &&   if [ -x "/sbin/ddcxinfo-knoppix" ] &&
186     [[ ${ALX_HSYNC} = auto ]] ||     [[ ${ALX_HSYNC} = auto ]] ||
# Line 284  config_x11() Line 203  config_x11()
203   echo 'Section "Device"' >> ${xfconfig}   echo 'Section "Device"' >> ${xfconfig}
204   echo '    Identifier  "vga0"' >> ${xfconfig}   echo '    Identifier  "vga0"' >> ${xfconfig}
205   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  
   
206   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
207    
208   # screens   # screens
# Line 336  config_x11() Line 233  config_x11()
233   echo '    Screen "Screen 1"' >> ${xfconfig}   echo '    Screen "Screen 1"' >> ${xfconfig}
234   echo '    InputDevice "Mouse1" "CorePointer"' >> ${xfconfig}   echo '    InputDevice "Mouse1" "CorePointer"' >> ${xfconfig}
235   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  
   
236   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
237    
238   # dri (here disabled, use default of xserver)   # dri (here disabled, use default of xserver)

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