1 |
|
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_x11.sh,v 1.9 2005-10-09 21:31:54 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 |
|
|
|
#delme settings |
|
|
SQL_USER=alx_install |
|
|
SQL_PASS=@lx |
|
|
SQL_HOST=128.20.41.110 |
|
|
SQL_DB=alx_web |
|
|
ALX_SERIAL=10 |
|
|
|
|
4 |
get_x11_settings() |
get_x11_settings() |
5 |
{ |
{ |
6 |
local x i all DB_X11SETTINGS |
local x i all DB_X11SETTINGS |
7 |
|
# autodetect |
8 |
# autodetect or not ? |
all=$(mysqldo "select module, |
9 |
if [ $(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
resolution, |
10 |
"select monitorid from cfg_graphic where serial='${ALX_SERIAL}") -gt 0 ] |
depth, |
11 |
then |
refresh_rate |
12 |
# settings from db |
from cfg_graphic where serial='${ALX_SERIAL}'") |
13 |
|
|
14 |
all=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
# split'em up and put 'em in an array |
15 |
"select cfg_graphic.module, |
declare -i i=0 |
16 |
cfg_graphic.resolution, |
for x in ${all} |
17 |
cfg_graphic.depth, |
do |
18 |
list_monitors.vendor, |
DB_X11SETTINGS[${i}]="${x}" |
19 |
list_monitors.model, |
((i++)) |
20 |
list_monitors.hsync, |
done |
21 |
list_monitors.vrefresh |
|
22 |
from list_monitors |
# and now put them in usable var names and export them systemwide |
23 |
inner join cfg_graphic |
export ALX_MODULE="${DB_X11SETTINGS[0]:=NULL}" |
24 |
on cfg_graphic.monitorid=list_monitors.id |
export ALX_RESOLUTION="${DB_X11SETTINGS[1]:=NULL}" |
25 |
and cfg_graphic.serial='${ALX_SERIAL}';") |
export ALX_DEPTH="${DB_X11SETTINGS[2]:=NULL}" |
26 |
|
export ALX_REFRESH_RATE="${DB_X11SETTINGS[3]:=NULL}" |
27 |
echo "DEBUG: ${all}" |
|
28 |
|
# which input devices are we using ? |
29 |
#split'em up and put 'em in an array |
ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'") |
|
declare -i i=0 |
|
|
for x in ${all} |
|
|
do |
|
|
DB_X11SETTINGS[${i}]="${x}" |
|
|
((i++)) |
|
|
done |
|
|
|
|
|
# and now put them in usable var names and export them systemwide |
|
|
export ALX_MODULE="${DB_X11SETTINGS[0]:=NULL}" |
|
|
export ALX_RESOLUTION="${DB_X11SETTINGS[1]:=NULL}" |
|
|
export ALX_DEPTH="${DB_X11SETTINGS[2]:=NULL}" |
|
|
export ALX_VENDOR="${DB_X11SETTINGS[3]:=NULL}" |
|
|
export ALX_MODEL="${DB_X11SETTINGS[4]:=NULL}" |
|
|
export ALX_HSYNC="${DB_X11SETTINGS[5]:=NULL}" |
|
|
export ALX_VREF="${DB_X11SETTINGS[6]:=NULL}" |
|
|
else |
|
|
# autodetect |
|
|
all=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
|
|
"select module, |
|
|
resolution, |
|
|
depth |
|
|
from cfg_graphic where serial='${ALX_SERIAL}'") |
|
|
|
|
|
echo "DEBUG: ${all}" |
|
|
|
|
|
#split'em up and put 'em in an array |
|
|
declare -i i=0 |
|
|
for x in ${all} |
|
|
do |
|
|
DB_X11SETTINGS[${i}]="${x}" |
|
|
((i++)) |
|
|
done |
|
|
|
|
|
# and now put them in usable var names and export them systemwide |
|
|
export ALX_MODULE="${DB_X11SETTINGS[0]:=NULL}" |
|
|
export ALX_RESOLUTION="${DB_X11SETTINGS[1]:=NULL}" |
|
|
export ALX_DEPTH="${DB_X11SETTINGS[2]:=NULL}" |
|
|
export ALX_VENDOR="Autodetected" |
|
|
export ALX_MODEL="Monitor" |
|
|
export ALX_HSYNC="auto" |
|
|
export ALX_VREF="auto" |
|
|
fi |
|
|
|
|
|
#which input devices are we using ? |
|
|
ALX_MOUSE=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
|
|
"select mouse from cfg_input where serial='${ALX_SERIAL}'") |
|
30 |
export ALX_MOUSE |
export ALX_MOUSE |
31 |
} |
} |
32 |
|
|
33 |
write_x11_config() { |
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() |
47 |
|
{ |
48 |
# get our settings from the db |
# get our settings from the db |
49 |
get_x11_settings |
get_x11_settings |
50 |
|
|
51 |
# DEBUG |
# setup displaymanager |
52 |
echo "MODULE: '${ALX_MODULE}'" |
config_display_manager |
53 |
echo "RESOLUTION: '${ALX_RESOLUTION}'" |
|
|
echo "DEPTH: '${ALX_DEPTH=}'" |
|
|
echo "VENDOR: '${ALX_VENDOR}'" |
|
|
echo "MODEL: '${ALX_MODEL}'" |
|
|
echo "HSYNC: '${ALX_HSYNC}'" |
|
|
echo "VREF: '${ALX_VREF}'" |
|
|
echo "MOUSE: '${ALX_MOUSE}'" |
|
|
|
|
54 |
local xserver |
local xserver |
55 |
local xfconfig |
local xfconfig |
56 |
local HAS_VNC |
local HAS_VNC |
57 |
|
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)" |
62 |
|
|
63 |
case ${xserver} in |
case ${xserver} in |
64 |
Xorg) |
Xorg) xfconfig=/etc/X11/xorg.conf ;; |
65 |
xfconfig=/etc/X11/xorg.conf |
XFree86) xfconfig=/etc/X11/XF86Config ;; |
66 |
;; |
*) echo " Unkown xserver. aborting."; exit 1 ;; |
|
XFree86) |
|
|
xfconfig=/etc/X11/XF86Config |
|
|
;; |
|
|
*) |
|
|
echo " Unkown xserver. aborting." |
|
|
exit 1 |
|
|
;; |
|
67 |
esac |
esac |
68 |
|
|
69 |
#got we vnc support ? |
# got we vnc support ? |
70 |
if [ -f /usr/X11R6/lib/modules/vnc.so ] |
if [ -f /usr/X11R6/lib/modules/vnc.so ] |
71 |
then |
then |
72 |
HAS_VNC="yes" |
HAS_VNC="yes" |
74 |
HAS_VNC="no" |
HAS_VNC="no" |
75 |
fi |
fi |
76 |
|
|
77 |
#show which server we use |
if [ -f /usr/X11R6/lib/modules/extensions/vnc.so ] |
78 |
|
then |
79 |
|
HAS_REALVNC="yes" |
80 |
|
else |
81 |
|
HAS_REALVNC="no" |
82 |
|
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 |
92 |
echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server " |
echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server " |
93 |
|
|
94 |
#show if we have vnc |
# show if we have vnc |
95 |
if [ "${HAS_VNC}" = "yes" ] |
if [[ ${HAS_VNC} = yes ]] |
96 |
then |
then |
97 |
echo "with vnc enabled ..." |
echo "with vnc enabled ..." |
98 |
|
elif [[ ${HAS_REALVNC} = yes ]] |
99 |
|
then |
100 |
|
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 |
107 |
|
|
108 |
#create a new clear xfconfig file |
# create a new clear xfconfig file |
109 |
echo '# Generated with hwdetect, part of Magellan-Linux initscripts.' > ${xfconfig} |
echo '# Generated with alxconfig-ng.' > ${xfconfig} |
110 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
111 |
|
|
112 |
#write modules |
# write modules |
113 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
114 |
echo 'Section "Module"' >> ${xfconfig} |
echo 'Section "Module"' >> ${xfconfig} |
115 |
echo ' Load "dbe"' >> ${xfconfig} |
echo ' Load "dbe"' >> ${xfconfig} |
116 |
echo ' SubSection "extmod"' >> ${xfconfig} |
echo ' SubSection "extmod"' >> ${xfconfig} |
117 |
echo ' Option "omit xfree86-dga"' >> ${xfconfig} |
echo ' Option "omit xfree86-dga"' >> ${xfconfig} |
118 |
echo ' EndSubSection' >> ${xfconfig} |
echo ' EndSubSection' >> ${xfconfig} |
|
echo ' Load "type1"' >> ${xfconfig} |
|
|
echo ' Load "speedo"' >> ${xfconfig} |
|
119 |
echo ' Load "freetype"' >> ${xfconfig} |
echo ' Load "freetype"' >> ${xfconfig} |
|
echo '# Load "xtt"' >> ${xfconfig} |
|
120 |
echo '# Load "glx"' >> ${xfconfig} |
echo '# Load "glx"' >> ${xfconfig} |
121 |
echo ' Load "dri"' >> ${xfconfig} |
echo ' Load "dri"' >> ${xfconfig} |
122 |
|
|
123 |
[ "${HAS_VNC}" = "yes" ] && echo ' Load "vnc"' >> ${xfconfig} |
[[ ${HAS_VNC} = yes ]] && echo ' Load "vnc"' >> ${xfconfig} |
124 |
|
[[ ${HAS_REALVNC} = yes ]] && echo ' Load "vnc"' >> ${xfconfig} |
125 |
|
[[ ${HAS_TIGERVNC} = yes ]] && echo ' Load "vnc"' >> ${xfconfig} |
126 |
|
|
127 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
128 |
|
|
129 |
#fonts |
# fonts |
130 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
131 |
echo 'Section "Files"' >> ${xfconfig} |
echo 'Section "Files"' >> ${xfconfig} |
|
echo ' RgbPath "/usr/X11R6/lib/X11/rgb"' >> ${xfconfig} |
|
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 ' #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig} |
[[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig} |
140 |
echo ' #FontPath "/usr/share/fonts/Speedo/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/TrueType/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} |
141 |
echo ' #FontPath "/usr/share/fonts/Type1/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/freefont/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} |
142 |
echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/75dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} |
143 |
echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/100dpi/fonts.dir ]] && echo ' FontPath "/usr/share/fonts/100dpi/"' >> ${xfconfig} |
|
echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} |
|
|
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} |
147 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/misc/"' >> ${xfconfig} |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/misc/"' >> ${xfconfig} |
148 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"' >> ${xfconfig} |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"' >> ${xfconfig} |
149 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/100dpi/: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} |
|
150 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"' >> ${xfconfig} |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"' >> ${xfconfig} |
151 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/freefont/"' >> ${xfconfig} |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/freefont/"' >> ${xfconfig} |
152 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"' >> ${xfconfig} |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"' >> ${xfconfig} |
154 |
;; |
;; |
155 |
esac |
esac |
156 |
|
|
|
echo '# ModulePath "/usr/X11R6/lib/modules"' >> ${xfconfig} |
|
157 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
158 |
|
|
159 |
#server flags |
# server flags |
160 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
161 |
echo 'Section "ServerFlags"' >> ${xfconfig} |
echo 'Section "ServerFlags"' >> ${xfconfig} |
162 |
echo '# Option "DontVTSwitch"' >> ${xfconfig} |
echo '# Option "DontVTSwitch"' >> ${xfconfig} |
164 |
echo '# Option "Dont Zoom"' >> ${xfconfig} |
echo '# Option "Dont Zoom"' >> ${xfconfig} |
165 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
166 |
|
|
167 |
#keyboard |
# keyboard |
168 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
169 |
echo 'Section "InputDevice"' >> ${xfconfig} |
echo 'Section "InputDevice"' >> ${xfconfig} |
170 |
echo ' Identifier "Keyboard1"' >> ${xfconfig} |
echo ' Identifier "Keyboard1"' >> ${xfconfig} |
171 |
|
|
172 |
case ${xserver} in |
case ${xserver} in |
173 |
Xorg) |
Xorg) echo ' Driver "kbd"' >> ${xfconfig} ;; |
174 |
echo ' Driver "kbd"' >> ${xfconfig} |
XFree86) echo ' Driver "Keyboard"' >> ${xfconfig} ;; |
|
;; |
|
|
XFree86) |
|
|
echo ' Driver "Keyboard"' >> ${xfconfig} |
|
|
;; |
|
175 |
esac |
esac |
176 |
|
|
177 |
echo ' Option "AutoRepeat" "500 30"' >> ${xfconfig} |
echo ' Option "AutoRepeat" "500 30"' >> ${xfconfig} |
178 |
echo '# Option "Xleds" "1 2 3"' >> ${xfconfig} |
echo '# Option "Xleds" "1 2 3"' >> ${xfconfig} |
179 |
|
|
180 |
case ${xserver} in |
case ${xserver} in |
181 |
Xorg) |
Xorg) echo ' Option "XkbRules" "xorg"' >> ${xfconfig} ;; |
182 |
echo ' Option "XkbRules" "xorg"' >> ${xfconfig} |
XFree86) echo ' Option "XkbRules" "xfree86"' >> ${xfconfig} ;; |
|
;; |
|
|
XFree86) |
|
|
echo ' Option "XkbRules" "xfree86"' >> ${xfconfig} |
|
|
;; |
|
183 |
esac |
esac |
184 |
|
|
185 |
echo ' Option "XkbModel" "pc104"' >> ${xfconfig} |
echo ' Option "XkbModel" "pc105"' >> ${xfconfig} |
186 |
echo ' Option "XkbLayout" "de"' >> ${xfconfig} |
echo ' Option "XkbLayout" "de"' >> ${xfconfig} |
187 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
188 |
|
|
189 |
#mouse |
# mouse |
190 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
191 |
echo 'Section "InputDevice"' >> ${xfconfig} |
echo 'Section "InputDevice"' >> ${xfconfig} |
192 |
echo ' Identifier "Mouse1"' >> ${xfconfig} |
echo ' Identifier "Mouse1"' >> ${xfconfig} |
199 |
Auto) device=/dev/mouse;; |
Auto) device=/dev/mouse;; |
200 |
*) device=/dev/mouse;; |
*) device=/dev/mouse;; |
201 |
esac |
esac |
202 |
|
echo " Option \"Device\" \"${device}\"" >> ${xfconfig} |
203 |
echo ' Option "Resolution" "1200"' >> ${xfconfig} |
echo ' Option "Resolution" "1200"' >> ${xfconfig} |
204 |
|
|
205 |
[ "${ALX_MOUSE}" = "IMPS/2" ] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |
[[ ${ALX_MOUSE} = IMPS/2 ]] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |
206 |
|
|
207 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
208 |
|
|
209 |
#vnc keyboard && mouse |
# vnc keyboard && mouse |
210 |
if [ "${HAS_VNC}" = "yes" ] |
if [[ ${HAS_VNC} = yes ]] |
211 |
then |
then |
212 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
213 |
echo 'Section "InputDevice"' >> ${xfconfig} |
echo 'Section "InputDevice"' >> ${xfconfig} |
222 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
223 |
fi |
fi |
224 |
|
|
225 |
|
# monitor |
226 |
|
echo '' >> ${xfconfig} |
227 |
|
echo 'Section "Monitor"' >> ${xfconfig} |
228 |
|
echo ' Identifier "Monitor0"' >> ${xfconfig} |
229 |
|
echo ' Option "DPMS"' >> ${xfconfig} |
230 |
|
|
231 |
#monitor |
# add hsync, vrefresh |
232 |
if [ -x "/sbin/ddcxinfo-knoppix" ] && |
if [[ -x /sbin/ddcxinfo-knoppix ]] |
|
[ "${ALX_HSYNC}" = "auto" ] || |
|
|
[ "${ALX_VREF}" = "auto" ] |
|
233 |
then |
then |
234 |
ddcxinfo-knoppix -monitor >> ${xfconfig} |
local hsync="$(ddcxinfo-knoppix -hsync)" |
235 |
else |
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} |
echo '' >> ${xfconfig} |
241 |
echo "# Monitor: ${ALX_VENDOR} ${ALX_MODEL}" >> ${xfconfig} |
echo " HorizSync ${hsync}" >> ${xfconfig} |
242 |
echo 'Section "Monitor"' >> ${xfconfig} |
echo " VertRefresh ${vsync}" >> ${xfconfig} |
|
echo ' Identifier "Monitor0"' >> ${xfconfig} |
|
|
echo " HorizSync ${ALX_HSYNC}" >> ${xfconfig} |
|
|
echo " VertRefresh ${ALX_VREF}" >> ${xfconfig} |
|
|
echo ' Option "DPMS"' >> ${xfconfig} |
|
|
echo 'EndSection' >> ${xfconfig} |
|
243 |
fi |
fi |
244 |
|
|
245 |
#vga |
# add cvt modelines |
246 |
|
echo '' >> ${xfconfig} |
247 |
|
local cvt="/usr/X11R6/bin/cvt" |
248 |
|
local modeline |
249 |
|
modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') |
250 |
|
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} |
258 |
|
|
259 |
|
# 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 |
271 |
if [ "${HAS_VNC}" = "yes" ] |
if [[ ${HAS_VNC} = yes ]] |
272 |
then |
then |
273 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
274 |
echo ' # rfb options' >> ${xfconfig} |
echo ' # rfb options' >> ${xfconfig} |
290 |
|
|
291 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
292 |
|
|
293 |
#screens |
# screens |
294 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
295 |
echo 'Section "Screen"' >> ${xfconfig} |
echo 'Section "Screen"' >> ${xfconfig} |
296 |
echo ' Identifier "Screen 1"' >> ${xfconfig} |
echo ' Identifier "Screen 1"' >> ${xfconfig} |
302 |
echo " Modes \"${ALX_RESOLUTION}\"" >> ${xfconfig} |
echo " Modes \"${ALX_RESOLUTION}\"" >> ${xfconfig} |
303 |
echo ' ViewPort 0 0' >> ${xfconfig} |
echo ' ViewPort 0 0' >> ${xfconfig} |
304 |
echo ' EndSubsection' >> ${xfconfig} |
echo ' EndSubsection' >> ${xfconfig} |
305 |
|
|
306 |
|
if [[ ${HAS_REALVNC} = yes ]] || [[ ${HAS_TIGERVNC} = yes ]] |
307 |
|
then |
308 |
|
echo ' Option "SecurityTypes" "VncAuth"' >> ${xfconfig} |
309 |
|
echo ' Option "UserPasswdVerifier" "VncAuth"' >> ${xfconfig} |
310 |
|
echo ' Option "PasswordFile" "/root/.vnc/passwd"' >> ${xfconfig} |
311 |
|
fi |
312 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
313 |
|
|
314 |
#server layout |
# server layout |
315 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
316 |
echo 'Section "ServerLayout"' >> ${xfconfig} |
echo 'Section "ServerLayout"' >> ${xfconfig} |
317 |
echo ' Identifier "Simple Layout"' >> ${xfconfig} |
echo ' Identifier "Simple Layout"' >> ${xfconfig} |
319 |
echo ' InputDevice "Mouse1" "CorePointer"' >> ${xfconfig} |
echo ' InputDevice "Mouse1" "CorePointer"' >> ${xfconfig} |
320 |
echo ' InputDevice "Keyboard1" "CoreKeyboard"' >> ${xfconfig} |
echo ' InputDevice "Keyboard1" "CoreKeyboard"' >> ${xfconfig} |
321 |
|
|
322 |
#load vnc keyboard && mouse |
# load vnc keyboard && mouse |
323 |
if [ "${HAS_VNC}" = "yes" ] |
if [[ ${HAS_VNC} = yes ]] |
324 |
then |
then |
325 |
echo ' InputDevice "vncMouse" "ExtraPointer"' >> ${xfconfig} |
echo ' InputDevice "vncMouse" "ExtraPointer"' >> ${xfconfig} |
326 |
echo ' InputDevice "vncKeyboard" "ExtraKeyboard"' >> ${xfconfig} |
echo ' InputDevice "vncKeyboard" "ExtraKeyboard"' >> ${xfconfig} |
328 |
|
|
329 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
330 |
|
|
331 |
#dri (here disabled, use default of xserver) |
# dri |
332 |
echo '' >> ${xfconfig} |
echo '' >> ${xfconfig} |
333 |
echo '# Section "DRI"' >> ${xfconfig} |
echo 'Section "DRI"' >> ${xfconfig} |
334 |
echo '# Mode 0666' >> ${xfconfig} |
echo ' Mode 0666' >> ${xfconfig} |
335 |
echo '# EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
336 |
} |
} |
337 |
|
|