Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2037 by niro, Wed May 11 09:14:50 2011 UTC revision 2148 by niro, Tue May 17 11:46:16 2011 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2  # configures the x11 server on the host via mysql db settings  # configures the x11 server on the host via mysql db settings
3    
 get_x11_settings()  
 {  
  local x i all DB_X11SETTINGS  
  # autodetect  
  all=$(mysqldo "select module,  
  resolution,  
  depth,  
  refresh_rate  
  from cfg_graphic where serial='${ALX_SERIAL}'")  
   
  # split'em up and put 'em in an array  
  declare -i i=0  
  for x in ${all}  
  do  
  DB_X11SETTINGS[${i}]="${x}"  
  ((i++))  
  done  
   
  # and now put them in usable var names and export them systemwide  
  export ALX_MODULE="${DB_X11SETTINGS[0]:=NULL}"  
  export ALX_RESOLUTION="${DB_X11SETTINGS[1]:=NULL}"  
  export ALX_DEPTH="${DB_X11SETTINGS[2]:=NULL}"  
  export ALX_REFRESH_RATE="${DB_X11SETTINGS[3]:=NULL}"  
   
  # which input devices are we using ?  
  ALX_MOUSE=$(mysqldo "select mouse from cfg_input where serial='${ALX_SERIAL}'")  
  export ALX_MOUSE  
 }  
   
4  config_display_manager()  config_display_manager()
5  {  {
6   # setup slim   # setup slim
# Line 45  config_x11() Line 16  config_x11()
16   local has_tigervnc   local has_tigervnc
17   local CONFIG   local CONFIG
18    
19   # get our settings f2rom the db   # get our settings from the db
20   get_x11_settings   evaluate_table cfg_graphic
21     evaluate_table cfg_input
22    
23   # setup displaymanager   # setup displaymanager
24   config_display_manager   config_display_manager
# Line 84  config_x11() Line 56  config_x11()
56   clearconfig   clearconfig
57   addconfig 'Section "Device"'   addconfig 'Section "Device"'
58   addconfig ' Identifier "Card0"'   addconfig ' Identifier "Card0"'
59   addconfig " Driver \"${ALX_MODULE}\""   addconfig " Driver \"${cfg_graphic_module}\""
60   addconfig 'EndSection'   addconfig 'EndSection'
61    
62   # vnc module   # vnc module
# Line 122  config_x11() Line 94  config_x11()
94   addconfig   addconfig
95   local cvt="/usr/X11R6/bin/cvt"   local cvt="/usr/X11R6/bin/cvt"
96   local modeline   local modeline
97   modeline=$("${cvt}" "${ALX_RESOLUTION%x*}" "${ALX_RESOLUTION#*x}" "${ALX_REFRESH_RATE}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')   modeline=$("${cvt}" "${cfg_graphic_resolution%x*}" "${cfg_graphic_resolution#*x}" "${cfg_graphic_refresh_rate}" | sed -e 's:^:\t:g' -e 's:_.*\":\":')
98   addconfig "${modeline}"   addconfig "${modeline}"
99   # add ddcxinfo-knoppix modelines (fallback)   # add ddcxinfo-knoppix modelines (fallback)
100   if [[ -x /sbin/ddcxinfo-knoppix ]]   if [[ -x /sbin/ddcxinfo-knoppix ]]
# Line 138  config_x11() Line 110  config_x11()
110   addconfig 'Section "Screen"'   addconfig 'Section "Screen"'
111   addconfig ' Identifier "Screen0"'   addconfig ' Identifier "Screen0"'
112   addconfig ' Monitor "Monitor0"'   addconfig ' Monitor "Monitor0"'
113   addconfig " DefaultDepth ${ALX_DEPTH}"   addconfig " DefaultDepth ${cfg_graphic_depth}"
114   addconfig ' SubSection "Display"'   addconfig ' SubSection "Display"'
115   addconfig " Depth ${ALX_DEPTH}"   addconfig " Depth ${cfg_graphic_depth}"
116   addconfig " Modes \"${ALX_RESOLUTION}\""   addconfig " Modes \"${cfg_graphic_resolution}\""
117   addconfig ' ViewPort 0 0'   addconfig ' ViewPort 0 0'
118   addconfig ' EndSubSection'   addconfig ' EndSubSection'
119   # vnc auth   # vnc auth
# Line 152  config_x11() Line 124  config_x11()
124   addconfig ' Option "PasswordFile" "/root/.vnc/passwd"'   addconfig ' Option "PasswordFile" "/root/.vnc/passwd"'
125   fi   fi
126   addconfig 'EndSection'   addconfig 'EndSection'
   
127  }  }

Legend:
Removed from v.2037  
changed lines
  Added in v.2148