Contents of /alx-src/tags/alxconf-0_6_0/functions/config_x11.sh
Parent Directory | Revision Log
Revision 2386 -
(show annotations)
(download)
(as text)
Tue Jun 14 17:20:39 2011 UTC (13 years, 3 months ago) by niro
Original Path: alx-src/branches/alxconf-060/functions/config_x11.sh
File MIME type: application/x-sh
File size: 3506 byte(s)
Tue Jun 14 17:20:39 2011 UTC (13 years, 3 months ago) by niro
Original Path: alx-src/branches/alxconf-060/functions/config_x11.sh
File MIME type: application/x-sh
File size: 3506 byte(s)
-disable LVDS1 virtual monitors on zotacs
1 | # $Id$ |
2 | # configures the x11 server on the host via mysql db settings |
3 | |
4 | config_display_manager() |
5 | { |
6 | # setup slim |
7 | cat ${ALX_SKELETONS}/slim/slim.conf > /etc/slim.conf |
8 | sed -i "s:@@USERNAME@@:${ALX_UNPRIV_USER}:" /etc/slim.conf |
9 | |
10 | # windowmanager |
11 | echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
12 | } |
13 | |
14 | config_x11() |
15 | { |
16 | local has_tigervnc |
17 | local CONFIG |
18 | |
19 | # get our settings from the db |
20 | evaluate_table cfg_graphic |
21 | evaluate_table cfg_input |
22 | |
23 | # setup displaymanager |
24 | config_display_manager |
25 | |
26 | # got we vnc support ? |
27 | if [ -f /usr/X11R6/lib/xorg/modules/extensions/libvnc.so ] |
28 | then |
29 | has_tigervnc="yes" |
30 | else |
31 | has_tigervnc="no" |
32 | fi |
33 | |
34 | # show which server we use |
35 | echo -en ${COLOREDSTAR}"Configuring Xorg x11-server " |
36 | |
37 | # show if we have vnc |
38 | if [[ ${has_tigervnc} = yes ]] |
39 | then |
40 | echo "with tigervnc enabled ..." |
41 | else |
42 | echo "..." |
43 | fi |
44 | |
45 | # set_input_keyboard |
46 | CONFIG="/etc/X11/xorg.conf.d/25-layout.conf" |
47 | clearconfig |
48 | addconfig 'Section "InputClass"' |
49 | addconfig ' Identifier "keyboard layout"' |
50 | addconfig ' MatchIsKeyboard "on"' |
51 | addconfig ' Option "XkbLayout" "de"' |
52 | addconfig 'EndSection' |
53 | |
54 | # graphic driver |
55 | CONFIG="/etc/X11/xorg.conf.d/25-device.conf" |
56 | clearconfig |
57 | addconfig 'Section "Device"' |
58 | addconfig ' Identifier "Card0"' |
59 | addconfig " Driver \"${cfg_graphic_module}\"" |
60 | addconfig 'EndSection' |
61 | |
62 | # vnc module |
63 | if [[ ${has_tigervnc} = yes ]] |
64 | then |
65 | CONFIG="/etc/X11/xorg.conf.d/25-module.conf" |
66 | clearconfig |
67 | addconfig 'Section "Module"' |
68 | addconfig ' Load "vnc"' |
69 | addconfig 'EndSection' |
70 | fi |
71 | |
72 | # monitor |
73 | CONFIG="/etc/X11/xorg.conf.d/25-monitor.conf" |
74 | clearconfig |
75 | addconfig 'Section "Monitor"' |
76 | addconfig ' Identifier "Monitor0"' |
77 | addconfig ' Option "DPMS"' |
78 | |
79 | # add hsync, vrefresh |
80 | if [[ -x /sbin/ddcxinfo-knoppix ]] |
81 | then |
82 | local hsync="$(ddcxinfo-knoppix -hsync)" |
83 | local vsync="$(ddcxinfo-knoppix -vsync)" |
84 | # fallback |
85 | [[ ${hsync} = 0-0 ]] && hsync="28-96" |
86 | [[ ${vsync} = 0-0 ]] && vsync="50-60" |
87 | |
88 | addconfig |
89 | addconfig " HorizSync ${hsync}" |
90 | addconfig " VertRefresh ${vsync}" |
91 | fi |
92 | |
93 | # add cvt modelines |
94 | addconfig |
95 | local cvt="/usr/X11R6/bin/cvt" |
96 | local modeline |
97 | modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') |
98 | addconfig "${modeline}" |
99 | # add ddcxinfo-knoppix modelines (fallback) |
100 | if [[ -x /sbin/ddcxinfo-knoppix ]] |
101 | then |
102 | addconfig |
103 | addconfig $(ddcxinfo-knoppix -modelines) |
104 | fi |
105 | addconfig 'EndSection' |
106 | |
107 | # screen |
108 | CONFIG="/etc/X11/xorg.conf.d/25-screen.conf" |
109 | clearconfig |
110 | addconfig 'Section "Screen"' |
111 | addconfig ' Identifier "Screen0"' |
112 | addconfig ' Monitor "Monitor0"' |
113 | addconfig " DefaultDepth ${cfg_graphic_depth}" |
114 | addconfig ' SubSection "Display"' |
115 | addconfig " Depth ${cfg_graphic_depth}" |
116 | addconfig " Modes \"${cfg_graphic_resolution}\"" |
117 | addconfig ' ViewPort 0 0' |
118 | addconfig ' EndSubSection' |
119 | # vnc auth |
120 | if [[ ${has_tigervnc} = yes ]] |
121 | then |
122 | addconfig ' Option "SecurityTypes" "VncAuth"' |
123 | addconfig ' Option "UserPasswdVerifier" "VncAuth"' |
124 | addconfig ' Option "PasswordFile" "/root/.vnc/passwd"' |
125 | fi |
126 | 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 | } |