1 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_x11.sh,v 1.7 2005-08-03 17:57:55 niro Exp $ |
# $Id$ |
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 |
|
# 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 |
|
# split'em up and put 'em in an array |
15 |
|
declare -i i=0 |
16 |
|
for x in ${all} |
17 |
|
do |
18 |
|
DB_X11SETTINGS[${i}]="${x}" |
19 |
|
((i++)) |
20 |
|
done |
21 |
|
|
22 |
|
# and now put them in usable var names and export them systemwide |
23 |
|
export ALX_MODULE="${DB_X11SETTINGS[0]:=NULL}" |
24 |
|
export ALX_RESOLUTION="${DB_X11SETTINGS[1]:=NULL}" |
25 |
|
export ALX_DEPTH="${DB_X11SETTINGS[2]:=NULL}" |
26 |
|
export ALX_REFRESH_RATE="${DB_X11SETTINGS[3]:=NULL}" |
27 |
|
|
28 |
|
# which input devices are we using ? |
29 |
|
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 |
32 |
|
} |
33 |
|
|
34 |
all=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
config_display_manager() |
35 |
"select cfg_graphic.module, |
{ |
36 |
cfg_graphic.resolution, |
# setup slim |
37 |
cfg_graphic.depth, |
cat ${ALX_SKELETONS}/slim/slim.conf > /etc/slim.conf |
38 |
list_monitors.vendor, |
sed -i "s:@@USERNAME@@:${ALX_UNPRIV_USER}:" /etc/slim.conf |
|
list_monitors.model, |
|
|
list_monitors.hsync, |
|
|
list_monitors.vrefresh |
|
|
from list_monitors |
|
|
inner join cfg_graphic |
|
|
on cfg_graphic.monitorid=list_monitors.id |
|
|
and cfg_graphic.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="${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 |
|
39 |
|
|
40 |
#which input devices are we using ? |
# setup xession |
41 |
ALX_MOUSE=$(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
sed -i "s:\(^GLOGIN=\).*:\1slim:" /etc/rc.config |
42 |
"select mouse from cfg_input where serial='${ALX_SERIAL}'") |
|
43 |
export ALX_MOUSE |
# windowmanager |
44 |
|
echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
45 |
|
} |
46 |
|
|
47 |
|
clearconfig() |
48 |
|
{ |
49 |
|
local xfconfig="/etc/X11/xorg.conf" |
50 |
|
:> ${xfconfig} |
51 |
} |
} |
52 |
|
|
53 |
config_x11() { |
addconfig() |
54 |
|
{ |
55 |
|
local value="$@" |
56 |
|
local xfconfig="/etc/X11/xorg.conf" |
57 |
|
|
58 |
|
echo "${value}" >> ${xfconfig} |
59 |
|
} |
60 |
|
|
61 |
|
config_x11() |
62 |
|
{ |
63 |
# get our settings from the db |
# get our settings from the db |
64 |
get_x11_settings |
get_x11_settings |
|
|
|
|
# DEBUG |
|
|
# echo "MODULE: '${ALX_MODULE}'" |
|
|
# 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}'" |
|
|
|
|
|
local xserver |
|
|
local xfconfig |
|
|
local HAS_VNC |
|
|
|
|
|
#xfree or xorg ? |
|
|
xserver="$(readlink /usr/X11R6/bin/X)" |
|
|
|
|
|
case ${xserver} in |
|
|
Xorg) |
|
|
xfconfig=/etc/X11/xorg.conf |
|
|
;; |
|
|
XFree86) |
|
|
xfconfig=/etc/X11/XF86Config |
|
|
;; |
|
|
*) |
|
|
echo " Unkown xserver. aborting." |
|
|
exit 1 |
|
|
;; |
|
|
esac |
|
65 |
|
|
66 |
#got we vnc support ? |
# setup displaymanager |
67 |
if [ -f /usr/X11R6/lib/modules/vnc.so ] |
config_display_manager |
68 |
|
|
69 |
|
local xserver=Xorg |
70 |
|
local HAS_TIGERVNC |
71 |
|
|
72 |
|
# got we vnc support ? |
73 |
|
if [ -f /usr/X11R6/lib/xorg/modules/extensions/libvnc.so ] |
74 |
then |
then |
75 |
HAS_VNC="yes" |
HAS_TIGERVNC="yes" |
76 |
else |
else |
77 |
HAS_VNC="no" |
HAS_TIGERVNC="no" |
78 |
fi |
fi |
79 |
|
|
80 |
#show which server we use |
# show which server we use |
81 |
echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server " |
echo -en ${COLOREDSTAR}"Configuring Xorg x11-server " |
82 |
|
|
83 |
#show if we have vnc |
# show if we have vnc |
84 |
if [ "${HAS_VNC}" = "yes" ] |
if [[ ${HAS_TIGERVNC} = yes ]] |
85 |
then |
then |
86 |
echo "with vnc enabled ..." |
echo "with tigervnc enabled ..." |
87 |
else |
else |
88 |
echo "..." |
echo "..." |
89 |
fi |
fi |
90 |
|
|
91 |
#create a new clear xfconfig file |
# create a new clear xfconfig file |
92 |
echo '# Generated with hwdetect, part of Magellan-Linux initscripts.' > ${xfconfig} |
clearconfig |
93 |
echo '' >> ${xfconfig} |
addconfig '# Generated with alxconfig-ng.' |
94 |
|
addconfig |
95 |
#write modules |
|
96 |
echo '' >> ${xfconfig} |
# write modules |
97 |
echo 'Section "Module"' >> ${xfconfig} |
addconfig |
98 |
echo ' Load "dbe"' >> ${xfconfig} |
addconfig 'Section "Module"' |
99 |
echo ' SubSection "extmod"' >> ${xfconfig} |
addconfig ' Load "dbe"' |
100 |
echo ' Option "omit xfree86-dga"' >> ${xfconfig} |
addconfig ' SubSection "extmod"' |
101 |
echo ' EndSubSection' >> ${xfconfig} |
addconfig ' Option "omit xfree86-dga"' |
102 |
echo ' Load "type1"' >> ${xfconfig} |
addconfig ' EndSubSection' |
103 |
echo ' Load "speedo"' >> ${xfconfig} |
addconfig ' Load "freetype"' |
104 |
echo ' Load "freetype"' >> ${xfconfig} |
addconfig '# Load "glx"' |
105 |
echo '# Load "xtt"' >> ${xfconfig} |
addconfig ' Load "dri"' |
106 |
echo '# Load "glx"' >> ${xfconfig} |
|
107 |
echo ' Load "dri"' >> ${xfconfig} |
[[ ${HAS_TIGERVNC} = yes ]] && addconfig ' Load "vnc"' |
108 |
|
|
109 |
[ "${HAS_VNC}" = "yes" ] && echo ' Load "vnc"' >> ${xfconfig} |
addconfig 'EndSection' |
110 |
|
|
111 |
echo 'EndSection' >> ${xfconfig} |
# fonts |
112 |
|
addconfig |
113 |
#fonts |
addconfig 'Section "Files"' |
114 |
echo '' >> ${xfconfig} |
# only add existing font pathes |
115 |
echo 'Section "Files"' >> ${xfconfig} |
[[ -f /usr/share/fonts/local/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/local/"' |
116 |
echo ' RgbPath "/usr/X11R6/lib/X11/rgb"' >> ${xfconfig} |
[[ -f /usr/share/fonts/misc/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/misc/"' |
117 |
|
[[ -f /usr/share/fonts/75dpi/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/75dpi/:unscaled"' |
118 |
case ${xserver} in |
[[ -f /usr/share/fonts/100dpi/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/100dpi/:unscaled"' |
119 |
Xorg) |
[[ -f /usr/share/fonts/TrueType/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/TrueType/"' |
120 |
echo ' FontPath "/usr/share/fonts/local/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/freefont/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/freefont/"' |
121 |
echo ' FontPath "/usr/share/fonts/misc/"' >> ${xfconfig} |
[[ -f /usr/share/fonts/75dpi/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/75dpi/"' |
122 |
echo ' FontPath "/usr/share/fonts/75dpi/:unscaled"' >> ${xfconfig} |
[[ -f /usr/share/fonts/100dpi/fonts.dir ]] && addconfig ' FontPath "/usr/share/fonts/100dpi/"' |
123 |
echo ' FontPath "/usr/share/fonts/100dpi/:unscaled"' >> ${xfconfig} |
addconfig 'EndSection' |
124 |
echo ' #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig} |
|
125 |
echo ' #FontPath "/usr/share/fonts/Speedo/"' >> ${xfconfig} |
# server flags |
126 |
echo ' #FontPath "/usr/share/fonts/Type1/"' >> ${xfconfig} |
addconfig |
127 |
echo ' FontPath "/usr/share/fonts/TrueType/"' >> ${xfconfig} |
addconfig 'Section "ServerFlags"' |
128 |
echo ' FontPath "/usr/share/fonts/freefont/"' >> ${xfconfig} |
addconfig '# Option "DontVTSwitch"' |
129 |
echo ' FontPath "/usr/share/fonts/75dpi/"' >> ${xfconfig} |
addconfig '# Option "DontZap"' |
130 |
echo ' FontPath "/usr/share/fonts/100dpi/"' >> ${xfconfig} |
addconfig '# Option "Dont Zoom"' |
131 |
;; |
addconfig 'EndSection' |
132 |
XFree86) |
|
133 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/local/"' >> ${xfconfig} |
# keyboard |
134 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/misc/"' >> ${xfconfig} |
addconfig |
135 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"' >> ${xfconfig} |
addconfig 'Section "InputDevice"' |
136 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"' >> ${xfconfig} |
addconfig ' Identifier "Keyboard1"' |
137 |
echo ' #prevents slow startup when disabled -> speedo, type1' >> ${xfconfig} |
addconfig ' Driver "kbd"' |
138 |
echo ' #FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"' >> ${xfconfig} |
addconfig ' Option "AutoRepeat" "500 30"' |
139 |
echo ' #FontPath "/usr/X11R6/lib/X11/fonts/Type1/"' >> ${xfconfig} |
addconfig '# Option "Xleds" "1 2 3"' |
140 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"' >> ${xfconfig} |
addconfig ' Option "XkbRules" "xorg"' |
141 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/freefont/"' >> ${xfconfig} |
addconfig ' Option "XkbModel" "pc105"' |
142 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"' >> ${xfconfig} |
addconfig ' Option "XkbLayout" "de"' |
143 |
echo ' FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"' >> ${xfconfig} |
addconfig 'EndSection' |
144 |
;; |
|
145 |
esac |
# mouse |
146 |
|
addconfig |
147 |
echo '# ModulePath "/usr/X11R6/lib/modules"' >> ${xfconfig} |
addconfig 'Section "InputDevice"' |
148 |
echo 'EndSection' >> ${xfconfig} |
addconfig ' Identifier "Mouse1"' |
149 |
|
addconfig ' Driver "mouse"' |
150 |
#server flags |
addconfig " Option \"Protocol\" \"${ALX_MOUSE}\"" |
|
echo '' >> ${xfconfig} |
|
|
echo 'Section "ServerFlags"' >> ${xfconfig} |
|
|
echo '# Option "DontVTSwitch"' >> ${xfconfig} |
|
|
echo '# Option "DontZap"' >> ${xfconfig} |
|
|
echo '# Option "Dont Zoom"' >> ${xfconfig} |
|
|
echo 'EndSection' >> ${xfconfig} |
|
|
|
|
|
#keyboard |
|
|
echo '' >> ${xfconfig} |
|
|
echo 'Section "InputDevice"' >> ${xfconfig} |
|
|
echo ' Identifier "Keyboard1"' >> ${xfconfig} |
|
|
|
|
|
case ${xserver} in |
|
|
Xorg) |
|
|
echo ' Driver "kbd"' >> ${xfconfig} |
|
|
;; |
|
|
XFree86) |
|
|
echo ' Driver "Keyboard"' >> ${xfconfig} |
|
|
;; |
|
|
esac |
|
|
|
|
|
echo ' Option "AutoRepeat" "500 30"' >> ${xfconfig} |
|
|
echo '# Option "Xleds" "1 2 3"' >> ${xfconfig} |
|
|
|
|
|
case ${xserver} in |
|
|
Xorg) |
|
|
echo ' Option "XkbRules" "xorg"' >> ${xfconfig} |
|
|
;; |
|
|
XFree86) |
|
|
echo ' Option "XkbRules" "xfree86"' >> ${xfconfig} |
|
|
;; |
|
|
esac |
|
|
|
|
|
echo ' Option "XkbModel" "pc105"' >> ${xfconfig} |
|
|
echo ' Option "XkbLayout" "de"' >> ${xfconfig} |
|
|
echo 'EndSection' >> ${xfconfig} |
|
|
|
|
|
#mouse |
|
|
echo '' >> ${xfconfig} |
|
|
echo 'Section "InputDevice"' >> ${xfconfig} |
|
|
echo ' Identifier "Mouse1"' >> ${xfconfig} |
|
|
echo ' Driver "mouse"' >> ${xfconfig} |
|
|
echo " Option \"Protocol\" \"${ALX_MOUSE}\"" >> ${xfconfig} |
|
|
|
|
151 |
local device |
local device |
152 |
case ${ALX_MOUSE} in |
case ${ALX_MOUSE} in |
153 |
IMPS/2|PS/2) device=/dev/psaux;; |
IMPS/2|PS/2) device=/dev/psaux;; |
154 |
Auto) device=/dev/mouse;; |
Auto) device=/dev/mouse;; |
155 |
*) device=/dev/mouse;; |
*) device=/dev/mouse;; |
156 |
esac |
esac |
157 |
echo " Option \"Device\" \"${device}\"" >> ${xfconfig} |
addconfig " Option \"Device\" \"${device}\"" |
158 |
echo ' Option "Resolution" "1200"' >> ${xfconfig} |
[[ -z ${ALX_MOUSE_RESOLUTION} ]] && ALX_MOUSE_RESOLUTION="1200" |
159 |
|
addconfig " Option \"Resolution\" \"${ALX_MOUSE_RESOLUTION}\"" |
160 |
[ "${ALX_MOUSE}" = "IMPS/2" ] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |
[[ ${ALX_MOUSE} = IMPS/2 ]] && addconfig ' Option "ZAxisMapping" "4 5"' |
161 |
|
addconfig 'EndSection' >> ${xfconfig} |
162 |
echo 'EndSection' >> ${xfconfig} |
|
163 |
|
# monitor |
164 |
#vnc keyboard && mouse |
addconfig |
165 |
if [ "${HAS_VNC}" = "yes" ] |
addconfig 'Section "Monitor"' |
166 |
then |
addconfig ' Identifier "Monitor0"' |
167 |
echo '' >> ${xfconfig} |
addconfig ' Option "DPMS"' |
168 |
echo 'Section "InputDevice"' >> ${xfconfig} |
|
169 |
echo ' Identifier "vncKeyboard"' >> ${xfconfig} |
# add hsync, vrefresh |
170 |
echo ' Driver "rfbkeyb"' >> ${xfconfig} |
if [[ -x /sbin/ddcxinfo-knoppix ]] |
171 |
echo 'EndSection' >> ${xfconfig} |
then |
172 |
|
local hsync="$(ddcxinfo-knoppix -hsync)" |
173 |
echo '' >> ${xfconfig} |
local vsync="$(ddcxinfo-knoppix -vsync)" |
174 |
echo 'Section "InputDevice"' >> ${xfconfig} |
# fallback |
175 |
echo ' Identifier "vncMouse"' >> ${xfconfig} |
[[ ${hsync} = 0-0 ]] && hsync="28-96" |
176 |
echo ' Driver "rfbmouse"' >> ${xfconfig} |
[[ ${vsync} = 0-0 ]] && vsync="50-60" |
177 |
echo 'EndSection' >> ${xfconfig} |
|
178 |
fi |
addconfig |
179 |
|
addconfig " HorizSync ${hsync}" |
180 |
|
addconfig " VertRefresh ${vsync}" |
181 |
#monitor |
fi |
182 |
if [ -x "/sbin/ddcxinfo-knoppix" ] && |
|
183 |
[ "${ALX_HSYNC}" = "auto" ] || |
# add cvt modelines |
184 |
[ "${ALX_VREF}" = "auto" ] |
addconfig |
185 |
then |
local cvt="/usr/X11R6/bin/cvt" |
186 |
ddcxinfo-knoppix -monitor >> ${xfconfig} |
local modeline |
187 |
else |
modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') |
188 |
echo '' >> ${xfconfig} |
addconfig "${modeline}" |
189 |
echo "# Monitor: ${ALX_VENDOR} ${ALX_MODEL}" >> ${xfconfig} |
# add ddcxinfo-knoppix modelines (fallback) |
190 |
echo 'Section "Monitor"' >> ${xfconfig} |
if [[ -x /sbin/ddcxinfo-knoppix ]] |
191 |
echo ' Identifier "Monitor0"' >> ${xfconfig} |
then |
192 |
echo " HorizSync ${ALX_HSYNC}" >> ${xfconfig} |
addconfig |
193 |
echo " VertRefresh ${ALX_VREF}" >> ${xfconfig} |
addconfig $(ddcxinfo-knoppix -modelines) |
194 |
echo ' Option "DPMS"' >> ${xfconfig} |
fi |
195 |
echo 'EndSection' >> ${xfconfig} |
addconfig 'EndSection' |
196 |
fi |
|
197 |
|
# vga |
198 |
#vga |
addconfig |
199 |
echo '' >> ${xfconfig} |
addconfig 'Section "Device"' |
200 |
echo 'Section "Device"' >> ${xfconfig} |
addconfig ' Identifier "vga0"' |
201 |
echo ' Identifier "vga0"' >> ${xfconfig} |
# check for openchrome and use it if available |
202 |
echo " Driver \"${ALX_MODULE}\"" >> ${xfconfig} |
if [[ ${ALX_MODULE} = via ]] && [ -f /usr/X11R6/lib/xorg/modules/drivers/openchrome_drv.so ] |
203 |
|
then |
204 |
#vnc server options |
ALX_MODULE="openchrome" |
205 |
if [ "${HAS_VNC}" = "yes" ] |
fi |
206 |
then |
addconfig " Driver \"${ALX_MODULE}\"" |
207 |
echo '' >> ${xfconfig} |
addconfig 'EndSection' |
208 |
echo ' # rfb options' >> ${xfconfig} |
|
209 |
echo ' Option "rfbauth" "/root/.vnc/passwd"' >> ${xfconfig} |
# screens |
210 |
echo ' Option "rfbport" "5900"' >> ${xfconfig} |
addconfig |
211 |
echo ' #Option "nevershared"' >> ${xfconfig} |
addconfig 'Section "Screen"' |
212 |
echo ' Option "alwaysshared"' >> ${xfconfig} |
addconfig ' Identifier "Screen 1"' |
213 |
echo ' Option "dontdisconnect"' >> ${xfconfig} |
addconfig ' Device "vga0"' |
214 |
echo ' Option "httpdir" "/usr/share/vnc/classes"' >> ${xfconfig} |
addconfig ' Monitor "Monitor0"' |
215 |
echo ' Option "httpport" "5800"' >> ${xfconfig} |
addconfig " DefaultDepth ${ALX_DEPTH}" |
216 |
echo ' # Option "useraccept"' >> ${xfconfig} |
addconfig ' Subsection "Display"' |
217 |
echo ' Option "usevnc"' >> ${xfconfig} |
addconfig " Depth ${ALX_DEPTH}" |
218 |
echo ' # Option "localhost"' >> ${xfconfig} |
addconfig " Modes \"${ALX_RESOLUTION}\"" |
219 |
echo ' # Option "interface" "192.168.0.1"' >> ${xfconfig} |
addconfig ' ViewPort 0 0' |
220 |
echo ' # Option "viewonly"' >> ${xfconfig} |
addconfig ' EndSubsection' |
221 |
echo ' # Option "loginauth"' >> ${xfconfig} |
if [[ ${HAS_TIGERVNC} = yes ]] |
222 |
echo '' >> ${xfconfig} |
then |
223 |
fi |
addconfig ' Option "SecurityTypes" "VncAuth"' |
224 |
|
addconfig ' Option "UserPasswdVerifier" "VncAuth"' |
225 |
echo 'EndSection' >> ${xfconfig} |
addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' |
226 |
|
fi |
227 |
#screens |
addconfig 'EndSection' |
228 |
echo '' >> ${xfconfig} |
|
229 |
echo 'Section "Screen"' >> ${xfconfig} |
# server layout |
230 |
echo ' Identifier "Screen 1"' >> ${xfconfig} |
addconfig |
231 |
echo ' Device "vga0"' >> ${xfconfig} |
addconfig 'Section "ServerLayout"' >> ${xfconfig} |
232 |
echo ' Monitor "Monitor0"' >> ${xfconfig} |
addconfig ' Identifier "Simple Layout"' >> ${xfconfig} |
233 |
echo " DefaultDepth ${ALX_DEPTH}" >> ${xfconfig} |
addconfig ' Screen "Screen 1"' >> ${xfconfig} |
234 |
echo ' Subsection "Display"' >> ${xfconfig} |
addconfig ' InputDevice "Mouse1" "CorePointer"' >> ${xfconfig} |
235 |
echo " Depth ${ALX_DEPTH}" >> ${xfconfig} |
addconfig ' InputDevice "Keyboard1" "CoreKeyboard"' >> ${xfconfig} |
236 |
echo " Modes \"${ALX_RESOLUTION}\"" >> ${xfconfig} |
addconfig 'EndSection' >> ${xfconfig} |
237 |
echo ' ViewPort 0 0' >> ${xfconfig} |
|
238 |
echo ' EndSubsection' >> ${xfconfig} |
# dri |
239 |
echo 'EndSection' >> ${xfconfig} |
addconfig |
240 |
|
addconfig 'Section "DRI"' >> ${xfconfig} |
241 |
#server layout |
addconfig ' Mode 0666' >> ${xfconfig} |
242 |
echo '' >> ${xfconfig} |
addconfig 'EndSection' >> ${xfconfig} |
|
echo 'Section "ServerLayout"' >> ${xfconfig} |
|
|
echo ' Identifier "Simple Layout"' >> ${xfconfig} |
|
|
echo ' Screen "Screen 1"' >> ${xfconfig} |
|
|
echo ' InputDevice "Mouse1" "CorePointer"' >> ${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 |
|
|
|
|
|
echo 'EndSection' >> ${xfconfig} |
|
|
|
|
|
#dri (here disabled, use default of xserver) |
|
|
echo '' >> ${xfconfig} |
|
|
echo '# Section "DRI"' >> ${xfconfig} |
|
|
echo '# Mode 0666' >> ${xfconfig} |
|
|
echo '# EndSection' >> ${xfconfig} |
|
243 |
} |
} |
|
|
|