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 |
25 |
|
|
26 |
# got we vnc support ? |
# got we vnc support ? |
27 |
if [ -f /usr/X11R6/lib/xorg/modules/extensions/libvnc.so ] |
if [ -f /usr/lib/xorg/modules/extensions/libvnc.so ] |
28 |
then |
then |
29 |
has_tigervnc="yes" |
has_tigervnc="yes" |
30 |
else |
else |
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 |
65 |
CONFIG="/etc/X11/xorg.conf.d/25-module.conf" |
CONFIG="/etc/X11/xorg.conf.d/25-module.conf" |
66 |
clearconfig |
clearconfig |
67 |
addconfig 'Section "Module"' |
addconfig 'Section "Module"' |
68 |
addconfig ' Load vnc' |
addconfig ' Load "vnc"' |
69 |
addconfig 'EndSection' |
addconfig 'EndSection' |
70 |
fi |
fi |
71 |
|
|
92 |
|
|
93 |
# add cvt modelines |
# add cvt modelines |
94 |
addconfig |
addconfig |
95 |
local cvt="/usr/X11R6/bin/cvt" |
local cvt="/usr/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 |
125 |
fi |
fi |
126 |
addconfig 'EndSection' |
addconfig 'EndSection' |
127 |
|
|
128 |
|
# fixes |
129 |
|
# disable LVDS-1 on zotacs |
130 |
|
if [[ ! -z $(hwinfo --bios --storage | grep -i zotac) ]] |
131 |
|
then |
132 |
|
CONFIG="/etc/X11/xorg.conf.d/30-fix-zotac.conf" |
133 |
|
clearconfig |
134 |
|
addconfig 'Section "Monitor"' |
135 |
|
addconfig ' Identifier "LVDS1"' |
136 |
|
addconfig ' Option "Ignore" "True"' |
137 |
|
addconfig 'EndSection' |
138 |
|
else |
139 |
|
# clear this file |
140 |
|
if [ -f /etc/X11/xorg.conf.d/30-fix-zotac.conf ] |
141 |
|
then |
142 |
|
rm /etc/X11/xorg.conf.d/30-fix-zotac.conf |
143 |
|
fi |
144 |
|
fi |
145 |
} |
} |