Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2165 - (hide annotations) (download) (as text)
Wed May 18 14:45:00 2011 UTC (12 years, 11 months ago) by niro
File MIME type: application/x-sh
File size: 3072 byte(s)
-fixed a typo
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     echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc
12     }
13    
14 niro 2037 config_x11()
15 niro 2004 {
16 niro 2037 local has_tigervnc
17     local CONFIG
18 niro 2004
19 niro 2148 # get our settings from the db
20     evaluate_table cfg_graphic
21     evaluate_table cfg_input
22 niro 1582
23 niro 1703 # setup displaymanager
24     config_display_manager
25    
26 niro 343 # got we vnc support ?
27 niro 1589 if [ -f /usr/X11R6/lib/xorg/modules/extensions/libvnc.so ]
28 niro 1586 then
29 niro 2037 has_tigervnc="yes"
30 niro 1586 else
31 niro 2037 has_tigervnc="no"
32 niro 1586 fi
33 niro 325
34 niro 343 # show which server we use
35 niro 2004 echo -en ${COLOREDSTAR}"Configuring Xorg x11-server "
36 niro 218
37 niro 343 # show if we have vnc
38 niro 2037 if [[ ${has_tigervnc} = yes ]]
39 niro 218 then
40 niro 1586 echo "with tigervnc enabled ..."
41 niro 218 else
42     echo "..."
43     fi
44    
45 niro 2037 # set_input_keyboard
46     CONFIG="/etc/X11/xorg.conf.d/25-layout.conf"
47 niro 2004 clearconfig
48 niro 2037 addconfig 'Section "InputClass"'
49     addconfig ' Identifier "keyboard layout"'
50     addconfig ' MatchIsKeyboard "on"'
51     addconfig ' Option "XkbLayout" "de"'
52 niro 2004 addconfig 'EndSection'
53 niro 218
54 niro 2037 # graphic driver
55     CONFIG="/etc/X11/xorg.conf.d/25-device.conf"
56     clearconfig
57     addconfig 'Section "Device"'
58     addconfig ' Identifier "Card0"'
59 niro 2148 addconfig " Driver \"${cfg_graphic_module}\""
60 niro 2004 addconfig 'EndSection'
61 niro 218
62 niro 2037 # 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 niro 2165 addconfig ' Load "vnc"'
69 niro 2037 addconfig 'EndSection'
70     fi
71 niro 218
72 niro 343 # monitor
73 niro 2037 CONFIG="/etc/X11/xorg.conf.d/25-monitor.conf"
74     clearconfig
75 niro 2004 addconfig 'Section "Monitor"'
76 niro 2037 addconfig ' Identifier "Monitor0"'
77     addconfig ' Option "DPMS"'
78 niro 1647
79     # add hsync, vrefresh
80     if [[ -x /sbin/ddcxinfo-knoppix ]]
81     then
82 niro 1653 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 niro 2037
88 niro 2004 addconfig
89 niro 2037 addconfig " HorizSync ${hsync}"
90     addconfig " VertRefresh ${vsync}"
91 niro 1647 fi
92    
93     # add cvt modelines
94 niro 2037 addconfig
95 niro 1582 local cvt="/usr/X11R6/bin/cvt"
96     local modeline
97 niro 2148 modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')
98 niro 2004 addconfig "${modeline}"
99 niro 1641 # add ddcxinfo-knoppix modelines (fallback)
100 niro 1647 if [[ -x /sbin/ddcxinfo-knoppix ]]
101     then
102 niro 2004 addconfig
103     addconfig $(ddcxinfo-knoppix -modelines)
104 niro 1647 fi
105 niro 2004 addconfig 'EndSection'
106 niro 218
107 niro 2037 # screen
108     CONFIG="/etc/X11/xorg.conf.d/25-screen.conf"
109     clearconfig
110 niro 2004 addconfig 'Section "Screen"'
111 niro 2037 addconfig ' Identifier "Screen0"'
112     addconfig ' Monitor "Monitor0"'
113 niro 2148 addconfig " DefaultDepth ${cfg_graphic_depth}"
114 niro 2037 addconfig ' SubSection "Display"'
115 niro 2148 addconfig " Depth ${cfg_graphic_depth}"
116     addconfig " Modes \"${cfg_graphic_resolution}\""
117 niro 2037 addconfig ' ViewPort 0 0'
118     addconfig ' EndSubSection'
119     # vnc auth
120     if [[ ${has_tigervnc} = yes ]]
121 niro 325 then
122 niro 2037 addconfig ' Option "SecurityTypes" "VncAuth"'
123     addconfig ' Option "UserPasswdVerifier" "VncAuth"'
124     addconfig ' Option "PasswordFile" "/root/.vnc/passwd"'
125 niro 325 fi
126 niro 2004 addconfig 'EndSection'
127 niro 218 }