Magellan Linux

Diff of /alx-src/branches/alxconf-060/functions/config_x11.sh

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

revision 1582 by niro, Tue Nov 23 12:24:14 2010 UTC revision 1710 by niro, Tue Jan 25 00:32:15 2011 UTC
# Line 30  get_x11_settings() Line 30  get_x11_settings()
30   export ALX_MOUSE   export ALX_MOUSE
31  }  }
32    
33    config_display_manager()
34    {
35     # setup slim
36     cat ${ALX_SKELETONS}/slim/slim.conf > /etc/slim.conf
37     sed -i "s:@@USERNAME@@:${ALX_UNPRIV_USER}:" /etc/slim.conf
38    
39     # setup xession
40     sed -i "s:\(^GLOGIN=\).*:\1slim:" /etc/rc.config
41    
42     # windowmanager
43     echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc
44    }
45    
46  config_x11()  config_x11()
47  {  {
48   # get our settings from the db   # get our settings from the db
49   get_x11_settings   get_x11_settings
50    
51     # setup displaymanager
52     config_display_manager
53    
54   local xserver   local xserver
55   local xfconfig   local xfconfig
56   local HAS_VNC   local HAS_VNC
57   local HAS_REALVNC   local HAS_REALVNC
58     local HAS_TIGERVNC
59    
60   # xfree or xorg ?   # xfree or xorg ?
61   xserver="$(readlink /usr/X11R6/bin/X)"   xserver="$(readlink /usr/X11R6/bin/X)"
# Line 64  config_x11() Line 81  config_x11()
81   HAS_REALVNC="no"   HAS_REALVNC="no"
82   fi   fi
83    
84     if [ -f /usr/X11R6/lib/xorg/modules/extensions/libvnc.so ]
85     then
86     HAS_TIGERVNC="yes"
87     else
88     HAS_TIGERVNC="no"
89     fi
90    
91   # show which server we use   # show which server we use
92   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "
93    
# Line 74  config_x11() Line 98  config_x11()
98   elif [[ ${HAS_REALVNC} = yes ]]   elif [[ ${HAS_REALVNC} = yes ]]
99   then   then
100   echo "with realvnc enabled ..."   echo "with realvnc enabled ..."
101     elif [[ ${HAS_TIGERVNC} = yes ]]
102     then
103     echo "with tigervnc enabled ..."
104   else   else
105   echo "..."   echo "..."
106   fi   fi
# Line 95  config_x11() Line 122  config_x11()
122    
123   [[ ${HAS_VNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}   [[ ${HAS_VNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}
124   [[ ${HAS_REALVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}   [[ ${HAS_REALVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}
125     [[ ${HAS_TIGERVNC} = yes ]] && echo '    Load       "vnc"' >> ${xfconfig}
126    
127   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
128    
# Line 104  config_x11() Line 132  config_x11()
132    
133   case ${xserver} in   case ${xserver} in
134   Xorg)   Xorg)
135   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}   # only add existing font pathes
136   echo '    FontPath   "/usr/share/fonts/misc/"' >> ${xfconfig}   [[ -f /usr/share/fonts/local/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}
137   echo '    FontPath   "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig}   [[ -f /usr/share/fonts/misc/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/misc/"' >> ${xfconfig}
138   echo '    FontPath   "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig}   [[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig}
139   echo '    FontPath   "/usr/share/fonts/TrueType/"' >> ${xfconfig}   [[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig}
140   echo '    FontPath   "/usr/share/fonts/freefont/"' >> ${xfconfig}   [[ -f /usr/share/fonts/TrueType/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/TrueType/"' >> ${xfconfig}
141   echo '    FontPath   "/usr/share/fonts/75dpi/"' >> ${xfconfig}   [[ -f /usr/share/fonts/freefont/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/freefont/"' >> ${xfconfig}
142   echo '    FontPath   "/usr/share/fonts/100dpi/"' >> ${xfconfig}   [[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/75dpi/"' >> ${xfconfig}
143     [[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo '    FontPath   "/usr/share/fonts/100dpi/"' >> ${xfconfig}
144   ;;   ;;
145   XFree86)   XFree86)
146   echo '    FontPath   "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig}   echo '    FontPath   "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig}
# Line 194  config_x11() Line 223  config_x11()
223   fi   fi
224    
225   # monitor   # monitor
226     echo '' >> ${xfconfig}
227   echo 'Section "Monitor"' >> ${xfconfig}   echo 'Section "Monitor"' >> ${xfconfig}
228   echo '    Identifier  "Monitor0"' >> ${xfconfig}   echo '    Identifier  "Monitor0"' >> ${xfconfig}
229   echo '    Option      "DPMS"' >> ${xfconfig}   echo '    Option      "DPMS"' >> ${xfconfig}
230   echo '' >> ${xfconfig}  
231     # add hsync, vrefresh
232     if [[ -x /sbin/ddcxinfo-knoppix ]]
233     then
234     local hsync="$(ddcxinfo-knoppix -hsync)"
235     local vsync="$(ddcxinfo-knoppix -vsync)"
236     # fallback
237     [[ ${hsync} = 0-0 ]] && hsync="28-96"
238     [[ ${vsync} = 0-0 ]] && vsync="50-60"
239    
240     echo '' >> ${xfconfig}
241     echo "    HorizSync ${hsync}"  >> ${xfconfig}
242     echo "    VertRefresh ${vsync}"  >> ${xfconfig}
243     fi
244    
245   # add cvt modelines   # add cvt modelines
246     echo '' >> ${xfconfig}
247   local cvt="/usr/X11R6/bin/cvt"   local cvt="/usr/X11R6/bin/cvt"
248   local modeline   local modeline
249   modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')   modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')
250   echo "${modeline}" >> ${xfconfig}   echo "${modeline}" >> ${xfconfig}
251     # add ddcxinfo-knoppix modelines (fallback)
252     if [[ -x /sbin/ddcxinfo-knoppix ]]
253     then
254     echo '' >> ${xfconfig}
255     ddcxinfo-knoppix -modelines >> ${xfconfig}
256     fi
257   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
258    
259   # vga   # vga
260   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
261   echo 'Section "Device"' >> ${xfconfig}   echo 'Section "Device"' >> ${xfconfig}
262   echo '    Identifier  "vga0"' >> ${xfconfig}   echo '    Identifier  "vga0"' >> ${xfconfig}
263     # check for openchrome and use it if available
264     if [[ ${ALX_MODULE} = via ]] && [ -f /usr/X11R6/lib/xorg/modules/drivers/openchrome_drv.so ]
265     then
266     ALX_MODULE="openchrome"
267     fi
268   echo "    Driver      \"${ALX_MODULE}\"" >> ${xfconfig}   echo "    Driver      \"${ALX_MODULE}\"" >> ${xfconfig}
269    
270   # vnc server options   # vnc server options
# Line 247  config_x11() Line 303  config_x11()
303   echo '        ViewPort    0 0' >> ${xfconfig}   echo '        ViewPort    0 0' >> ${xfconfig}
304   echo '    EndSubsection' >> ${xfconfig}   echo '    EndSubsection' >> ${xfconfig}
305    
306   if [[ ${HAS_REALVNC} = yes ]]   if [[ ${HAS_REALVNC} = yes ]] || [[ ${HAS_TIGERVNC} = yes ]]
307   then   then
308   echo '    Option "SecurityTypes" "VncAuth"' >> ${xfconfig}   echo '    Option "SecurityTypes" "VncAuth"' >> ${xfconfig}
309   echo '    Option "UserPasswdVerifier" "VncAuth"' >> ${xfconfig}   echo '    Option "UserPasswdVerifier" "VncAuth"' >> ${xfconfig}

Legend:
Removed from v.1582  
changed lines
  Added in v.1710