Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.client.class.in

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

mcore-src/trunk/mcore-tools/daemon/client/include/graphic.client.class revision 1643 by niro, Thu Mar 10 18:12:54 2011 UTC mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.client.class.in revision 2194 by niro, Fri Jan 10 14:41:09 2014 UTC
# Line 25  helper_graphic_rebuild_xorg_conf_d() Line 25  helper_graphic_rebuild_xorg_conf_d()
25    
26   # rebuild 25-gfxcard.conf   # rebuild 25-gfxcard.conf
27   # always clear the config   # always clear the config
28   CONFIG="/etc/X11/xorg.conf.d/25-device.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-device.conf"
29   clearconfig   clearconfig
30     addconfig "# Autogenerated by mcored"
31   # but only add lines if some values are found in config.d dir   # but only add lines if some values are found in config.d dir
32   if path_not_empty ${MCORE_CONFIG_PATH}/xorg/device   if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/device
33   then   then
34   addconfig 'Section "Device"'   addconfig 'Section "Device"'
35   helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/device   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/device
36   addconfig 'EndSection'   addconfig 'EndSection'
37   fi   fi
38    
39   # rebuild 25-module.conf   # rebuild 25-module.conf
40   # always clear the config   # always clear the config
41   CONFIG="/etc/X11/xorg.conf.d/25-module.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-module.conf"
42   clearconfig   clearconfig
43     addconfig "# Autogenerated by mcored"
44   # but only add lines if some values are found in config.d dir   # but only add lines if some values are found in config.d dir
45   if path_not_empty ${MCORE_CONFIG_PATH}/xorg/module   if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/module
46   then   then
47   addconfig 'Section "Module"'   addconfig 'Section "Module"'
48   helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/module   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/module
49   addconfig 'EndSection'   addconfig 'EndSection'
50   fi   fi
51    
52   # rebuild 25-screen.conf   # rebuild 25-screen.conf
53   # always clear the config   # always clear the config
54   CONFIG="/etc/X11/xorg.conf.d/25-screen.conf"   CONFIG="${MROOT}@@SYSCONFDIR@@/X11/xorg.conf.d/25-screen.conf"
55   clearconfig   clearconfig
56     addconfig "# Autogenerated by mcored"
57   # but only add lines if some values are found in config.d dir   # but only add lines if some values are found in config.d dir
58   if path_not_empty ${MCORE_CONFIG_PATH}/xorg/screen   if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen
59   then   then
60   addconfig 'Section "Screen"'   addconfig 'Section "Screen"'
61   addconfig ' Identifier "Screen0"'   addconfig ' Identifier "Screen0"'
62   addconfig ' Monitor "Monitor0"'   addconfig ' Monitor "Monitor0"'
63   helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/screen   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen
64   addconfig 'EndSection'   addconfig 'EndSection'
65   fi   fi
66  }  }
# Line 100  set_graphic_resolution() Line 103  set_graphic_resolution()
103   local depth   local depth
104   [[ -z ${resolution} ]] && help_graphic_resolution && return 1   [[ -z ${resolution} ]] && help_graphic_resolution && return 1
105    
106   CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf"
107   clearconfig   clearconfig
108   # do it for all supported color depth   # do it for all supported color depth
109   for depth in 1 4 8 15 16 24   for depth in 1 4 8 15 16 24
# Line 112  set_graphic_resolution() Line 115  set_graphic_resolution()
115   addconfig ' EndSubSection'   addconfig ' EndSubSection'
116   done   done
117    
118   x11runas "xrandr --size ${resolution}"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
119     then
120     x11runas "xrandr --size ${resolution}"
121     fi
122    
123   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
124  }  }
# Line 127  set_graphic_depth() Line 133  set_graphic_depth()
133   # do it only for supported color depths   # do it only for supported color depths
134   case "${depth}" in   case "${depth}" in
135   1|4|8|15|16|24)   1|4|8|15|16|24)
136   CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"
137   clearconfig   clearconfig
138   addconfig " DefaultDepth ${depth}"   addconfig " DefaultDepth ${depth}"
139   ;;   ;;
140   *) help_graphic_depth && return 1 ;;   *) help_graphic_depth && return 1 ;;
141   esac   esac
142    
 # if pidof X  
 # then  
 # x11runas "xrandr --size ${value}"  
 # fi  
   
143   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
144   mecho "X11 restart required!"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
145     then
146     mecho "X11 restart required!"
147     fi
148  }  }
149    
150  # set_graphic_refresh ${value}  # set_graphic_refresh ${value}
# Line 149  set_graphic_refresh() Line 153  set_graphic_refresh()
153   local value="$1"   local value="$1"
154   [[ -z ${value} ]] && help_graphic_refresh && return 1   [[ -z ${value} ]] && help_graphic_refresh && return 1
155    
156   #echo "${value}" > ${SETTINGSPATH}/xorg/refresh   #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh
157    
158   x11runas "xrandr --refresh ${value}"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
159     then
160     x11runas "xrandr --refresh ${value}"
161     fi
162    
163   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
164  }  }
# Line 159  set_graphic_refresh() Line 166  set_graphic_refresh()
166  set_graphic_driver()  set_graphic_driver()
167  {  {
168   local driver="$1"   local driver="$1"
169   local driverdir="/usr/lib/xorg/modules/drivers"   local driverdir="@@LIBDIR@@/xorg/modules/drivers"
170   local CONFIG   local CONFIG
171   [[ -z ${driver} ]] && help_graphic_driver && return 1   [[ -z ${driver} ]] && help_graphic_driver && return 1
172    
173   if [[ -f ${driverdir}/${driver}_drv.so ]]   if [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]]
174   then   then
175   CONFIG="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
176   clearconfig   clearconfig
177   addconfig " Identifier \"Card0\""   addconfig " Identifier \"Card0\""
178   addconfig " Driver \"${driver}\""   addconfig " Driver \"${driver}\""
179    
180   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
181   mecho "X11 restart required!"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
182     then
183     mecho "X11 restart required!"
184     fi
185   else   else
186   eecho "Driver '${driver}' does not exist on this system. Aborted!"   eecho "Driver '${driver}' does not exist on this system. Aborted!"
187   fi   fi
# Line 180  set_graphic_driver() Line 190  set_graphic_driver()
190  get_graphic_driver()  get_graphic_driver()
191  {  {
192   local action="$1"   local action="$1"
193   local driverdir="/usr/lib/xorg/modules/drivers"   local driverdir="@@LIBDIR@@/xorg/modules/drivers"
194   local driver   local driver
195   local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
196   local i   local i
197    
198   case "${action}" in   case "${action}" in
199   current)   current)
200   if [[ -f ${config} ]]   if [[ -f ${MROOT}/${config} ]]
201   then   then
202   driver=$(grep Driver "${config}" | sed 's:.*Driver.*\"\(.*\)\":\1:')   driver=$(grep Driver "${MROOT}/${config}" | sed 's:.*Driver.*\"\(.*\)\":\1:')
203   rvecho "${driver}"   rvecho "${driver}"
204   else   else
205   rvecho "none"   rvecho "none"
206   fi   fi
207   ;;   ;;
208   system)   system)
209   for i in $(find ${driverdir} -mindepth 1 -maxdepth 1 -type f | sort)   driver=$(list_files_in_directory ${MROOT}/${driverdir} -mindepth 1 -maxdepth 1 | sed s':_drv.so::g')
  do  
  driver="${driver} $(basename ${i} _drv.so)"  
  done  
210   rvecho "${driver}"   rvecho "${driver}"
211   ;;   ;;
212   *)   *)

Legend:
Removed from v.1643  
changed lines
  Added in v.2194