Magellan Linux

Annotation of /alx-src/branches/alxconf-060/functions/config_x11.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7976 - (hide annotations) (download) (as text)
Thu Dec 10 09:05:53 2015 UTC (8 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 4380 byte(s)
-allow configuration of the i845 chipset hack
1 niro 2004 # $Id$
2 niro 218 # configures the x11 server on the host via mysql db settings
3    
4 niro 1703 config_display_manager()
5     {
6     # setup slim
7     cat ${ALX_SKELETONS}/slim/slim.conf > /etc/slim.conf
8 niro 1710 sed -i "s:@@USERNAME@@:${ALX_UNPRIV_USER}:" /etc/slim.conf
9 niro 1703
10     # windowmanager
11 niro 3478 local CONFIG="${ALX_UNPRIV_HOME}/.xinitrc"
12     clearconfig
13     addconfig "exec startfluxbox"
14 niro 1703 }
15    
16 niro 2037 config_x11()
17 niro 2004 {
18 niro 2037 local has_tigervnc
19     local CONFIG
20 niro 2004
21 niro 2148 # get our settings from the db
22     evaluate_table cfg_graphic
23     evaluate_table cfg_input
24 niro 1582
25 niro 1703 # setup displaymanager
26     config_display_manager
27    
28 niro 343 # got we vnc support ?
29 niro 2615 if [ -f /usr/lib/xorg/modules/extensions/libvnc.so ]
30 niro 1586 then
31 niro 2037 has_tigervnc="yes"
32 niro 1586 else
33 niro 2037 has_tigervnc="no"
34 niro 1586 fi
35 niro 325
36 niro 343 # show which server we use
37 niro 3477 rc_echo -en ${COLOREDSTAR}"Configuring Xorg x11-server "
38 niro 218
39 niro 343 # show if we have vnc
40 niro 2037 if [[ ${has_tigervnc} = yes ]]
41 niro 218 then
42 niro 3477 rc_echo "with tigervnc enabled ..."
43 niro 218 else
44 niro 3477 rc_echo "..."
45 niro 218 fi
46    
47 niro 2037 # set_input_keyboard
48     CONFIG="/etc/X11/xorg.conf.d/25-layout.conf"
49 niro 2004 clearconfig
50 niro 2037 addconfig 'Section "InputClass"'
51     addconfig ' Identifier "keyboard layout"'
52     addconfig ' MatchIsKeyboard "on"'
53     addconfig ' Option "XkbLayout" "de"'
54 niro 2004 addconfig 'EndSection'
55 niro 218
56 niro 2037 # graphic driver
57     CONFIG="/etc/X11/xorg.conf.d/25-device.conf"
58     clearconfig
59     addconfig 'Section "Device"'
60     addconfig ' Identifier "Card0"'
61 niro 5585
62 niro 7976 if [[ $(alx-hwdetection system) = i845 ]] && [[ ${cfg_graphic_i845_hack} = enable ]]
63 niro 5585 then
64     addconfig ' # i845 hack - using vesa driver atm'
65     addconfig ' Driver "vesa"'
66     else
67     addconfig " Driver \"${cfg_graphic_module}\""
68     fi
69    
70 niro 2004 addconfig 'EndSection'
71 niro 218
72 niro 2037 # vnc module
73     if [[ ${has_tigervnc} = yes ]]
74     then
75     CONFIG="/etc/X11/xorg.conf.d/25-module.conf"
76     clearconfig
77     addconfig 'Section "Module"'
78 niro 2165 addconfig ' Load "vnc"'
79 niro 2037 addconfig 'EndSection'
80     fi
81 niro 218
82 niro 343 # monitor
83 niro 2037 CONFIG="/etc/X11/xorg.conf.d/25-monitor.conf"
84     clearconfig
85 niro 2004 addconfig 'Section "Monitor"'
86 niro 2037 addconfig ' Identifier "Monitor0"'
87     addconfig ' Option "DPMS"'
88 niro 1647
89     # add hsync, vrefresh
90     if [[ -x /sbin/ddcxinfo-knoppix ]]
91     then
92 niro 1653 local hsync="$(ddcxinfo-knoppix -hsync)"
93     local vsync="$(ddcxinfo-knoppix -vsync)"
94     # fallback
95     [[ ${hsync} = 0-0 ]] && hsync="28-96"
96     [[ ${vsync} = 0-0 ]] && vsync="50-60"
97 niro 4836
98 niro 2004 addconfig
99 niro 2037 addconfig " HorizSync ${hsync}"
100     addconfig " VertRefresh ${vsync}"
101 niro 1647 fi
102    
103     # add cvt modelines
104 niro 2037 addconfig
105 niro 2612 local cvt="/usr/bin/cvt"
106 niro 1582 local modeline
107 niro 2148 modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')
108 niro 2004 addconfig "${modeline}"
109 niro 1641 # add ddcxinfo-knoppix modelines (fallback)
110 niro 1647 if [[ -x /sbin/ddcxinfo-knoppix ]]
111     then
112 niro 2004 addconfig
113     addconfig $(ddcxinfo-knoppix -modelines)
114 niro 1647 fi
115 niro 2004 addconfig 'EndSection'
116 niro 218
117 niro 2037 # screen
118     CONFIG="/etc/X11/xorg.conf.d/25-screen.conf"
119     clearconfig
120 niro 2004 addconfig 'Section "Screen"'
121 niro 2037 addconfig ' Identifier "Screen0"'
122     addconfig ' Monitor "Monitor0"'
123 niro 2148 addconfig " DefaultDepth ${cfg_graphic_depth}"
124 niro 2037 addconfig ' SubSection "Display"'
125 niro 2148 addconfig " Depth ${cfg_graphic_depth}"
126     addconfig " Modes \"${cfg_graphic_resolution}\""
127 niro 2037 addconfig ' ViewPort 0 0'
128     addconfig ' EndSubSection'
129     # vnc auth
130     if [[ ${has_tigervnc} = yes ]]
131 niro 325 then
132 niro 2037 addconfig ' Option "SecurityTypes" "VncAuth"'
133     addconfig ' Option "UserPasswdVerifier" "VncAuth"'
134     addconfig ' Option "PasswordFile" "/root/.vnc/passwd"'
135 niro 325 fi
136 niro 2004 addconfig 'EndSection'
137 niro 2386
138 niro 3438 # disable screen blanks, use xscreensaver for it
139     CONFIG="/etc/X11/xorg.conf.d/25-server.conf"
140     clearconfig
141     addconfig 'Section "ServerFlags"'
142     addconfig ' Option "BlankTime" "0"'
143     addconfig ' Option "StandbyTime" "0"'
144     addconfig ' Option "SuspendTime" "0"'
145     addconfig ' Option "OffTime" "0"'
146     addconfig 'EndSection'
147    
148 niro 2386 # fixes
149 niro 3277 # disable LVDS-1 on zotacs or enable it if hdmi was requested
150     if [[ $(alx-hwdetection system) = zotac ]]
151 niro 2386 then
152     CONFIG="/etc/X11/xorg.conf.d/30-fix-zotac.conf"
153     clearconfig
154     addconfig 'Section "Monitor"'
155     addconfig ' Identifier "LVDS1"'
156 niro 3277 if [[ ${cfg_graphic_hdmi} = enable ]]
157     then
158     # add cvt modelines
159     addconfig
160     local cvt="/usr/bin/cvt"
161     local modeline
162     modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')
163     addconfig "${modeline}"
164     else
165     addconfig ' Option "Ignore" "True"'
166     fi
167 niro 2386 addconfig 'EndSection'
168     else
169     # clear this file
170     if [ -f /etc/X11/xorg.conf.d/30-fix-zotac.conf ]
171     then
172     rm /etc/X11/xorg.conf.d/30-fix-zotac.conf
173     fi
174     fi
175 niro 218 }