1 |
# $Id$ |
# $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 |
|
|
|
get_x11_settings() |
|
|
{ |
|
|
local x i all DB_X11SETTINGS |
|
|
# autodetect |
|
|
all=$(mysqldo "select module, |
|
|
resolution, |
|
|
depth, |
|
|
refresh_rate |
|
|
from cfg_graphic where serial='${ALX_SERIAL}'") |
|
|
|
|
|
# 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_REFRESH_RATE="${DB_X11SETTINGS[3]:=NULL}" |
|
|
|
|
|
# which input devices are we using ? |
|
|
ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'") |
|
|
export ALX_MOUSE |
|
|
} |
|
|
|
|
4 |
config_display_manager() |
config_display_manager() |
5 |
{ |
{ |
6 |
# setup slim |
# setup slim |
16 |
local has_tigervnc |
local has_tigervnc |
17 |
local CONFIG |
local CONFIG |
18 |
|
|
19 |
# get our settings f2rom the db |
# get our settings from the db |
20 |
get_x11_settings |
evaluate_table cfg_graphic |
21 |
|
evaluate_table cfg_input |
22 |
|
|
23 |
# setup displaymanager |
# setup displaymanager |
24 |
config_display_manager |
config_display_manager |
56 |
clearconfig |
clearconfig |
57 |
addconfig 'Section "Device"' |
addconfig 'Section "Device"' |
58 |
addconfig ' Identifier "Card0"' |
addconfig ' Identifier "Card0"' |
59 |
addconfig " Driver \"${ALX_MODULE}\"" |
addconfig " Driver \"${cfg_graphic_module}\"" |
60 |
addconfig 'EndSection' |
addconfig 'EndSection' |
61 |
|
|
62 |
# vnc module |
# vnc module |
94 |
addconfig |
addconfig |
95 |
local cvt="/usr/X11R6/bin/cvt" |
local cvt="/usr/X11R6/bin/cvt" |
96 |
local modeline |
local modeline |
97 |
modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') |
modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') |
98 |
addconfig "${modeline}" |
addconfig "${modeline}" |
99 |
# add ddcxinfo-knoppix modelines (fallback) |
# add ddcxinfo-knoppix modelines (fallback) |
100 |
if [[ -x /sbin/ddcxinfo-knoppix ]] |
if [[ -x /sbin/ddcxinfo-knoppix ]] |
110 |
addconfig 'Section "Screen"' |
addconfig 'Section "Screen"' |
111 |
addconfig ' Identifier "Screen0"' |
addconfig ' Identifier "Screen0"' |
112 |
addconfig ' Monitor "Monitor0"' |
addconfig ' Monitor "Monitor0"' |
113 |
addconfig " DefaultDepth ${ALX_DEPTH}" |
addconfig " DefaultDepth ${cfg_graphic_depth}" |
114 |
addconfig ' SubSection "Display"' |
addconfig ' SubSection "Display"' |
115 |
addconfig " Depth ${ALX_DEPTH}" |
addconfig " Depth ${cfg_graphic_depth}" |
116 |
addconfig " Modes \"${ALX_RESOLUTION}\"" |
addconfig " Modes \"${cfg_graphic_resolution}\"" |
117 |
addconfig ' ViewPort 0 0' |
addconfig ' ViewPort 0 0' |
118 |
addconfig ' EndSubSection' |
addconfig ' EndSubSection' |
119 |
# vnc auth |
# vnc auth |
124 |
addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' |
addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' |
125 |
fi |
fi |
126 |
addconfig 'EndSection' |
addconfig 'EndSection' |
|
|
|
127 |
} |
} |