--- mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.client.class.in 2017/04/07 07:58:43 2812 +++ mcore-src/trunk/mcore-tools/src/modules/basic-video/graphic.client.class.in 2017/04/07 08:00:51 2813 @@ -68,19 +68,19 @@ help_graphic_resolution() { mecho "set graphic.resolution [resolution]" - mecho " 800x600, 1024x768, 1280x1024 etc" + mecho " auto, 800x600, 1024x768, 1280x1024 etc" } help_graphic_refresh() { mecho "set graphic.refresh [refresh rate]" - mecho " 60, 100 - all values are Hz" + mecho " auto, 60, 100 - all values are Hz" } help_graphic_depth() { mecho "set graphic.depth [color-depth]" - mecho " 1, 4, 8, 15, 16, 24 - all values are bits" + mecho " auto, 1, 4, 8, 15, 16, 24 - all values are bits" } help_graphic_driver() @@ -104,21 +104,27 @@ [[ -z ${resolution} ]] && help_graphic_resolution && return 1 CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf" - clearconfig - # do it for all supported color depth - for depth in 1 4 8 15 16 24 - do - addconfig ' SubSection "Display"' - addconfig " Depth ${depth}" - addconfig " Modes \"${resolution}\"" - addconfig ' ViewPort 0 0' - addconfig ' EndSubSection' - done - - if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] - then - x11runas "xrandr --size ${resolution}" - fi + + case ${depth} in + *x*) + clearconfig + # do it for all supported color depth + for depth in 1 4 8 15 16 24 + do + addconfig ' SubSection "Display"' + addconfig " Depth ${depth}" + addconfig " Modes \"${resolution}\"" + addconfig ' ViewPort 0 0' + addconfig ' EndSubSection' + done + + if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] + then + x11runas "xrandr --size ${resolution}" + fi + ;; + auto) clearconfig ;; + esac helper_graphic_rebuild_xorg_conf_d } @@ -130,13 +136,15 @@ local CONFIG [[ -z ${depth} ]] && help_graphic_depth && return 1 + CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf" + # do it only for supported color depths case "${depth}" in 1|4|8|15|16|24) - CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf" clearconfig addconfig " DefaultDepth ${depth}" ;; + auto) clearconfig ;; *) help_graphic_depth && return 1 ;; esac