Contents of /alx-src/branches/alxconf-060/functions/config_x11.sh
Parent Directory | Revision Log
Revision 3438 -
(show annotations)
(download)
(as text)
Wed Apr 11 11:42:24 2012 UTC (12 years ago) by niro
File MIME type: application/x-sh
File size: 4156 byte(s)
Wed Apr 11 11:42:24 2012 UTC (12 years ago) by niro
File MIME type: application/x-sh
File size: 4156 byte(s)
-disabled screen blanks to fix FS#19
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/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/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 | # disable screen blanks, use xscreensaver for it |
129 | CONFIG="/etc/X11/xorg.conf.d/25-server.conf" |
130 | clearconfig |
131 | addconfig 'Section "ServerFlags"' |
132 | addconfig ' Option "BlankTime" "0"' |
133 | addconfig ' Option "StandbyTime" "0"' |
134 | addconfig ' Option "SuspendTime" "0"' |
135 | addconfig ' Option "OffTime" "0"' |
136 | addconfig 'EndSection' |
137 | |
138 | # fixes |
139 | # disable LVDS-1 on zotacs or enable it if hdmi was requested |
140 | if [[ $(alx-hwdetection system) = zotac ]] |
141 | then |
142 | CONFIG="/etc/X11/xorg.conf.d/30-fix-zotac.conf" |
143 | clearconfig |
144 | addconfig 'Section "Monitor"' |
145 | addconfig ' Identifier "LVDS1"' |
146 | if [[ ${cfg_graphic_hdmi} = enable ]] |
147 | then |
148 | # add cvt modelines |
149 | addconfig |
150 | local cvt="/usr/bin/cvt" |
151 | local modeline |
152 | modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":') |
153 | addconfig "${modeline}" |
154 | else |
155 | addconfig ' Option "Ignore" "True"' |
156 | fi |
157 | addconfig 'EndSection' |
158 | else |
159 | # clear this file |
160 | if [ -f /etc/X11/xorg.conf.d/30-fix-zotac.conf ] |
161 | then |
162 | rm /etc/X11/xorg.conf.d/30-fix-zotac.conf |
163 | fi |
164 | fi |
165 | } |