27 |
|
|
28 |
# which input devices are we using ? |
# which input devices are we using ? |
29 |
ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'") |
ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'") |
30 |
|
ALX_MOUSE_RESOLUTION=$(mysqldo "select mouse_resolution from cfg_input where serial='${ALX_SERIAL}'") |
31 |
export ALX_MOUSE |
export ALX_MOUSE |
32 |
} |
} |
33 |
|
|
34 |
|
config_display_manager() |
35 |
|
{ |
36 |
|
# setup slim |
37 |
|
cat ${ALX_SKELETONS}/slim/slim.conf > /etc/slim.conf |
38 |
|
sed -i "s:@@USERNAME@@:${ALX_UNPRIV_USER}:" /etc/slim.conf |
39 |
|
|
40 |
|
# setup xession |
41 |
|
sed -i "s:\(^GLOGIN=\).*:\1slim:" /etc/rc.config |
42 |
|
|
43 |
|
# windowmanager |
44 |
|
echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
45 |
|
} |
46 |
|
|
47 |
config_x11() |
config_x11() |
48 |
{ |
{ |
49 |
# get our settings from the db |
# get our settings from the db |
50 |
get_x11_settings |
get_x11_settings |
51 |
|
|
52 |
|
# setup displaymanager |
53 |
|
config_display_manager |
54 |
|
|
55 |
local xserver |
local xserver |
56 |
local xfconfig |
local xfconfig |
57 |
local HAS_VNC |
local HAS_VNC |
133 |
|
|
134 |
case ${xserver} in |
case ${xserver} in |
135 |
Xorg) |
Xorg) |
136 |
echo ' FontPath "/usr/share/fonts/local/"' >> ${xfconfig} |
# only add existing font pathes |
137 |
echo ' FontPath "/usr/share/fonts/misc/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/local/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/local/"' >> ${xfconfig} |
138 |
echo ' FontPath "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig} |
[[ -f /usr/share/fonts/misc/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/misc/"' >> ${xfconfig} |
139 |
echo ' FontPath "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig} |
[[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig} |
140 |
echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig} |
141 |
echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/TrueType/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} |
142 |
echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/freefont/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} |
143 |
echo ' FontPath "/usr/share/fonts/100dpi/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} |
144 |
|
[[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/100dpi/"' >> ${xfconfig} |
145 |
;; |
;; |
146 |
XFree86) |
XFree86) |
147 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig} |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig} |
201 |
*) device=/dev/mouse;; |
*) device=/dev/mouse;; |
202 |
esac |
esac |
203 |
echo " Option \"Device\" \"${device}\"" >> ${xfconfig} |
echo " Option \"Device\" \"${device}\"" >> ${xfconfig} |
204 |
echo ' Option "Resolution" "1200"' >> ${xfconfig} |
|
205 |
|
[[ -z ${ALX_MOUSE_RESOLUTION} ]] && ALX_MOUSE_RESOLUTION="1200" |
206 |
|
echo " Option \"Resolution\" \"${ALX_MOUSE_RESOLUTION}\"" >> ${xfconfig} |
207 |
|
|
208 |
[[ ${ALX_MOUSE} = IMPS/2 ]] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |
[[ ${ALX_MOUSE} = IMPS/2 ]] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |
209 |
|
|
226 |
fi |
fi |
227 |
|
|
228 |
# monitor |
# monitor |
229 |
|
echo '' >> ${xfconfig} |
230 |
echo 'Section "Monitor"' >> ${xfconfig} |
echo 'Section "Monitor"' >> ${xfconfig} |
231 |
echo ' Identifier "Monitor0"' >> ${xfconfig} |
echo ' Identifier "Monitor0"' >> ${xfconfig} |
232 |
echo ' Option "DPMS"' >> ${xfconfig} |
echo ' Option "DPMS"' >> ${xfconfig} |
233 |
echo '' >> ${xfconfig} |
|
234 |
|
# add hsync, vrefresh |
235 |
|
if [[ -x /sbin/ddcxinfo-knoppix ]] |
236 |
|
then |
237 |
|
local hsync="$(ddcxinfo-knoppix -hsync)" |
238 |
|
local vsync="$(ddcxinfo-knoppix -vsync)" |
239 |
|
# fallback |
240 |
|
[[ ${hsync} = 0-0 ]] && hsync="28-96" |
241 |
|
[[ ${vsync} = 0-0 ]] && vsync="50-60" |
242 |
|
|
243 |
|
echo '' >> ${xfconfig} |
244 |
|
echo " HorizSync ${hsync}" >> ${xfconfig} |
245 |
|
echo " VertRefresh ${vsync}" >> ${xfconfig} |
246 |
|
fi |
247 |
|
|
248 |
# add cvt modelines |
# add cvt modelines |
249 |
|
echo '' >> ${xfconfig} |
250 |
local cvt="/usr/X11R6/bin/cvt" |
local cvt="/usr/X11R6/bin/cvt" |
251 |
local modeline |
local modeline |
252 |
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:_.*\":\":') |
253 |
echo "${modeline}" >> ${xfconfig} |
echo "${modeline}" >> ${xfconfig} |
254 |
|
# add ddcxinfo-knoppix modelines (fallback) |
255 |
|
if [[ -x /sbin/ddcxinfo-knoppix ]] |
256 |
|
then |
257 |
|
echo '' >> ${xfconfig} |
258 |
|
ddcxinfo-knoppix -modelines >> ${xfconfig} |
259 |
|
fi |
260 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
261 |
|
|
262 |
# vga |
# vga |
263 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
264 |
echo 'Section "Device"' >> ${xfconfig} |
echo 'Section "Device"' >> ${xfconfig} |
265 |
echo ' Identifier "vga0"' >> ${xfconfig} |
echo ' Identifier "vga0"' >> ${xfconfig} |
266 |
|
# check for openchrome and use it if available |
267 |
|
if [[ ${ALX_MODULE} = via ]] && [ -f /usr/X11R6/lib/xorg/modules/drivers/openchrome_drv.so ] |
268 |
|
then |
269 |
|
ALX_MODULE="openchrome" |
270 |
|
fi |
271 |
echo " Driver \"${ALX_MODULE}\"" >> ${xfconfig} |
echo " Driver \"${ALX_MODULE}\"" >> ${xfconfig} |
272 |
|
|
273 |
# vnc server options |
# vnc server options |