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 $ |
2 |
# configures the x11 server on the host via mysql db settings |
# configures the x11 server on the host via mysql db settings |
|
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_x11.sh,v 1.2 2005-03-08 20:42:05 niro Exp $ |
|
3 |
|
|
4 |
get_x11_settings() |
get_x11_settings() |
5 |
{ |
{ |
7 |
|
|
8 |
# autodetect or not ? |
# autodetect or not ? |
9 |
if [ $(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
if [ $(mysql_command ${SQL_USER} ${SQL_PASS} ${SQL_HOST} ${SQL_DB} \ |
10 |
"select monitorid from cfg_graphic where serial='${ALX_SERIAL}") -gt 0 ] |
"select monitorid from cfg_graphic where serial='${ALX_SERIAL}'") -gt 0 ] |
11 |
then |
then |
12 |
# settings from db |
# settings from db |
13 |
|
|
24 |
on cfg_graphic.monitorid=list_monitors.id |
on cfg_graphic.monitorid=list_monitors.id |
25 |
and cfg_graphic.serial='${ALX_SERIAL}';") |
and cfg_graphic.serial='${ALX_SERIAL}';") |
26 |
|
|
27 |
echo "DEBUG: ${all}" |
# echo "DEBUG: ${all}" |
28 |
|
|
29 |
#split'em up and put 'em in an array |
#split'em up and put 'em in an array |
30 |
declare -i i=0 |
declare -i i=0 |
50 |
depth |
depth |
51 |
from cfg_graphic where serial='${ALX_SERIAL}'") |
from cfg_graphic where serial='${ALX_SERIAL}'") |
52 |
|
|
53 |
echo "DEBUG: ${all}" |
# echo "DEBUG: ${all}" |
54 |
|
|
55 |
#split'em up and put 'em in an array |
#split'em up and put 'em in an array |
56 |
declare -i i=0 |
declare -i i=0 |
76 |
export ALX_MOUSE |
export ALX_MOUSE |
77 |
} |
} |
78 |
|
|
79 |
write_x11_config() { |
config_x11() { |
80 |
|
|
81 |
# get our settings from the db |
# get our settings from the db |
82 |
get_x11_settings |
get_x11_settings |
83 |
|
|
84 |
# DEBUG |
# DEBUG |
85 |
echo "MODULE: '${ALX_MODULE}'" |
# echo "MODULE: '${ALX_MODULE}'" |
86 |
echo "RESOLUTION: '${ALX_RESOLUTION}'" |
# echo "RESOLUTION: '${ALX_RESOLUTION}'" |
87 |
echo "DEPTH: '${ALX_DEPTH=}'" |
# echo "DEPTH: '${ALX_DEPTH=}'" |
88 |
echo "VENDOR: '${ALX_VENDOR}'" |
# echo "VENDOR: '${ALX_VENDOR}'" |
89 |
echo "MODEL: '${ALX_MODEL}'" |
# echo "MODEL: '${ALX_MODEL}'" |
90 |
echo "HSYNC: '${ALX_HSYNC}'" |
# echo "HSYNC: '${ALX_HSYNC}'" |
91 |
echo "VREF: '${ALX_VREF}'" |
# echo "VREF: '${ALX_VREF}'" |
92 |
echo "MOUSE: '${ALX_MOUSE}'" |
# echo "MOUSE: '${ALX_MOUSE}'" |
93 |
|
|
94 |
local xserver |
local xserver |
95 |
local xfconfig |
local xfconfig |
223 |
;; |
;; |
224 |
esac |
esac |
225 |
|
|
226 |
echo ' Option "XkbModel" "pc104"' >> ${xfconfig} |
echo ' Option "XkbModel" "pc105"' >> ${xfconfig} |
227 |
echo ' Option "XkbLayout" "de"' >> ${xfconfig} |
echo ' Option "XkbLayout" "de"' >> ${xfconfig} |
228 |
echo 'EndSection' >> ${xfconfig} |
echo 'EndSection' >> ${xfconfig} |
229 |
|
|
240 |
Auto) device=/dev/mouse;; |
Auto) device=/dev/mouse;; |
241 |
*) device=/dev/mouse;; |
*) device=/dev/mouse;; |
242 |
esac |
esac |
243 |
|
echo " Option \"Device\" \"${device}\"" >> ${xfconfig} |
244 |
echo ' Option "Resolution" "1200"' >> ${xfconfig} |
echo ' Option "Resolution" "1200"' >> ${xfconfig} |
245 |
|
|
246 |
[ "${ALX_MOUSE}" = "IMPS/2" ] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |
[ "${ALX_MOUSE}" = "IMPS/2" ] && echo ' Option "ZAxisMapping" "4 5"' >> ${xfconfig} |