Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/daemon/client/include/graphic.client.class

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

revision 1920 by niro, Wed Nov 9 13:35:31 2011 UTC revision 2018 by niro, Mon Aug 13 11:08:28 2012 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}/etc/X11/xorg.conf.d/25-device.conf"
29   clearconfig   clearconfig
30   # 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
31   if path_not_empty ${MCORE_CONFIG_PATH}/xorg/device   if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/device
32   then   then
33   addconfig 'Section "Device"'   addconfig 'Section "Device"'
34   helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/device   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/device
35   addconfig 'EndSection'   addconfig 'EndSection'
36   fi   fi
37    
38   # rebuild 25-module.conf   # rebuild 25-module.conf
39   # always clear the config   # always clear the config
40   CONFIG="/etc/X11/xorg.conf.d/25-module.conf"   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-module.conf"
41   clearconfig   clearconfig
42   # 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
43   if path_not_empty ${MCORE_CONFIG_PATH}/xorg/module   if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/module
44   then   then
45   addconfig 'Section "Module"'   addconfig 'Section "Module"'
46   helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/module   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/module
47   addconfig 'EndSection'   addconfig 'EndSection'
48   fi   fi
49    
50   # rebuild 25-screen.conf   # rebuild 25-screen.conf
51   # always clear the config   # always clear the config
52   CONFIG="/etc/X11/xorg.conf.d/25-screen.conf"   CONFIG="${MROOT}/etc/X11/xorg.conf.d/25-screen.conf"
53   clearconfig   clearconfig
54   # 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
55   if path_not_empty ${MCORE_CONFIG_PATH}/xorg/screen   if path_not_empty ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen
56   then   then
57   addconfig 'Section "Screen"'   addconfig 'Section "Screen"'
58   addconfig ' Identifier "Screen0"'   addconfig ' Identifier "Screen0"'
59   addconfig ' Monitor "Monitor0"'   addconfig ' Monitor "Monitor0"'
60   helper_graphic_add_configs ${MCORE_CONFIG_PATH}/xorg/screen   helper_graphic_add_configs ${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen
61   addconfig 'EndSection'   addconfig 'EndSection'
62   fi   fi
63  }  }
# Line 100  set_graphic_resolution() Line 100  set_graphic_resolution()
100   local depth   local depth
101   [[ -z ${resolution} ]] && help_graphic_resolution && return 1   [[ -z ${resolution} ]] && help_graphic_resolution && return 1
102    
103   CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf"
104   clearconfig   clearconfig
105   # do it for all supported color depth   # do it for all supported color depth
106   for depth in 1 4 8 15 16 24   for depth in 1 4 8 15 16 24
# Line 112  set_graphic_resolution() Line 112  set_graphic_resolution()
112   addconfig ' EndSubSection'   addconfig ' EndSubSection'
113   done   done
114    
115   x11runas "xrandr --size ${resolution}"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
116     then
117     x11runas "xrandr --size ${resolution}"
118     fi
119    
120   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
121  }  }
# Line 127  set_graphic_depth() Line 130  set_graphic_depth()
130   # do it only for supported color depths   # do it only for supported color depths
131   case "${depth}" in   case "${depth}" in
132   1|4|8|15|16|24)   1|4|8|15|16|24)
133   CONFIG="${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf"
134   clearconfig   clearconfig
135   addconfig " DefaultDepth ${depth}"   addconfig " DefaultDepth ${depth}"
136   ;;   ;;
# Line 135  set_graphic_depth() Line 138  set_graphic_depth()
138   esac   esac
139    
140   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
141   mecho "X11 restart required!"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
142     then
143     mecho "X11 restart required!"
144     fi
145  }  }
146    
147  # set_graphic_refresh ${value}  # set_graphic_refresh ${value}
# Line 144  set_graphic_refresh() Line 150  set_graphic_refresh()
150   local value="$1"   local value="$1"
151   [[ -z ${value} ]] && help_graphic_refresh && return 1   [[ -z ${value} ]] && help_graphic_refresh && return 1
152    
153   #echo "${value}" > ${SETTINGSPATH}/xorg/refresh   #echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh
154    
155   x11runas "xrandr --refresh ${value}"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
156     then
157     x11runas "xrandr --refresh ${value}"
158     fi
159    
160   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
161  }  }
# Line 158  set_graphic_driver() Line 167  set_graphic_driver()
167   local CONFIG   local CONFIG
168   [[ -z ${driver} ]] && help_graphic_driver && return 1   [[ -z ${driver} ]] && help_graphic_driver && return 1
169    
170   if [[ -f ${driverdir}/${driver}_drv.so ]]   if [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]]
171   then   then
172   CONFIG="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf"
173   clearconfig   clearconfig
174   addconfig " Identifier \"Card0\""   addconfig " Identifier \"Card0\""
175   addconfig " Driver \"${driver}\""   addconfig " Driver \"${driver}\""
176    
177   helper_graphic_rebuild_xorg_conf_d   helper_graphic_rebuild_xorg_conf_d
178   mecho "X11 restart required!"   if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
179     then
180     mecho "X11 restart required!"
181     fi
182   else   else
183   eecho "Driver '${driver}' does not exist on this system. Aborted!"   eecho "Driver '${driver}' does not exist on this system. Aborted!"
184   fi   fi
# Line 182  get_graphic_driver() Line 194  get_graphic_driver()
194    
195   case "${action}" in   case "${action}" in
196   current)   current)
197   if [[ -f ${config} ]]   if [[ -f ${MROOT}/${config} ]]
198   then   then
199   driver=$(grep Driver "${config}" | sed 's:.*Driver.*\"\(.*\)\":\1:')   driver=$(grep Driver "${MROOT}/${config}" | sed 's:.*Driver.*\"\(.*\)\":\1:')
200   rvecho "${driver}"   rvecho "${driver}"
201   else   else
202   rvecho "none"   rvecho "none"
203   fi   fi
204   ;;   ;;
205   system)   system)
206   for i in $(find ${driverdir} -mindepth 1 -maxdepth 1 -type f | sort)   for i in $(find ${MROOT}/${driverdir} -mindepth 1 -maxdepth 1 -type f | sort)
207   do   do
208   driver="${driver} $(basename ${i} _drv.so)"   driver="${driver} $(basename ${i} _drv.so)"
209   done   done

Legend:
Removed from v.1920  
changed lines
  Added in v.2018