68 |
help_graphic_resolution() |
help_graphic_resolution() |
69 |
{ |
{ |
70 |
mecho "set graphic.resolution [resolution]" |
mecho "set graphic.resolution [resolution]" |
71 |
mecho " 800x600, 1024x768, 1280x1024 etc" |
mecho " auto, 800x600, 1024x768, 1280x1024 etc" |
72 |
} |
} |
73 |
|
|
74 |
help_graphic_refresh() |
help_graphic_refresh() |
75 |
{ |
{ |
76 |
mecho "set graphic.refresh [refresh rate]" |
mecho "set graphic.refresh [refresh rate]" |
77 |
mecho " 60, 100 - all values are Hz" |
mecho " auto, 60, 100 - all values are Hz" |
78 |
} |
} |
79 |
|
|
80 |
help_graphic_depth() |
help_graphic_depth() |
81 |
{ |
{ |
82 |
mecho "set graphic.depth [color-depth]" |
mecho "set graphic.depth [color-depth]" |
83 |
mecho " 1, 4, 8, 15, 16, 24 - all values are bits" |
mecho " auto, 1, 4, 8, 15, 16, 24 - all values are bits" |
84 |
} |
} |
85 |
|
|
86 |
help_graphic_driver() |
help_graphic_driver() |
98 |
# set_graphic_resolution ${value} |
# set_graphic_resolution ${value} |
99 |
set_graphic_resolution() |
set_graphic_resolution() |
100 |
{ |
{ |
101 |
local resolution="$1" |
local resolution="${CLASS_ARGV[0]}" |
102 |
local CONFIG |
local CONFIG |
103 |
local depth |
local depth |
104 |
[[ -z ${resolution} ]] && help_graphic_resolution && return 1 |
[[ -z ${resolution} ]] && help_graphic_resolution && return 1 |
105 |
|
|
106 |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/20-resolution.conf" |
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 |
|
107 |
|
|
108 |
if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] |
case ${depth} in |
109 |
then |
*x*) |
110 |
x11runas "xrandr --size ${resolution}" |
clearconfig |
111 |
fi |
# do it for all supported color depth |
112 |
|
for depth in 1 4 8 15 16 24 |
113 |
|
do |
114 |
|
addconfig ' SubSection "Display"' |
115 |
|
addconfig " Depth ${depth}" |
116 |
|
addconfig " Modes \"${resolution}\"" |
117 |
|
addconfig ' ViewPort 0 0' |
118 |
|
addconfig ' EndSubSection' |
119 |
|
done |
120 |
|
|
121 |
|
if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] |
122 |
|
then |
123 |
|
x11runas "xrandr --size ${resolution}" |
124 |
|
fi |
125 |
|
;; |
126 |
|
auto) clearconfig ;; |
127 |
|
esac |
128 |
|
|
129 |
helper_graphic_rebuild_xorg_conf_d |
helper_graphic_rebuild_xorg_conf_d |
130 |
} |
} |
132 |
# set_graphic_depth ${value} |
# set_graphic_depth ${value} |
133 |
set_graphic_depth() |
set_graphic_depth() |
134 |
{ |
{ |
135 |
local depth="$1" |
local depth="${CLASS_ARGV[0]}" |
136 |
local CONFIG |
local CONFIG |
137 |
[[ -z ${depth} ]] && help_graphic_depth && return 1 |
[[ -z ${depth} ]] && help_graphic_depth && return 1 |
138 |
|
|
139 |
|
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf" |
140 |
|
|
141 |
# do it only for supported color depths |
# do it only for supported color depths |
142 |
case "${depth}" in |
case "${depth}" in |
143 |
1|4|8|15|16|24) |
1|4|8|15|16|24) |
|
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/screen/10-depth.conf" |
|
144 |
clearconfig |
clearconfig |
145 |
addconfig " DefaultDepth ${depth}" |
addconfig " DefaultDepth ${depth}" |
146 |
;; |
;; |
147 |
|
auto) clearconfig ;; |
148 |
*) help_graphic_depth && return 1 ;; |
*) help_graphic_depth && return 1 ;; |
149 |
esac |
esac |
150 |
|
|
158 |
# set_graphic_refresh ${value} |
# set_graphic_refresh ${value} |
159 |
set_graphic_refresh() |
set_graphic_refresh() |
160 |
{ |
{ |
161 |
local value="$1" |
local value="${CLASS_ARGV[0]}" |
162 |
[[ -z ${value} ]] && help_graphic_refresh && return 1 |
[[ -z ${value} ]] && help_graphic_refresh && return 1 |
163 |
|
|
164 |
#echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh |
#echo "${value}" > ${MROOT}/${MCORE_CONFIG_PATH}/xorg/refresh |
173 |
|
|
174 |
set_graphic_driver() |
set_graphic_driver() |
175 |
{ |
{ |
176 |
local driver="$1" |
local driver="${CLASS_ARGV[0]}" |
177 |
local driverdir="@@LIBDIR@@/xorg/modules/drivers" |
local driverdir="@@LIBDIR@@/xorg/modules/drivers" |
178 |
local CONFIG |
local CONFIG |
179 |
[[ -z ${driver} ]] && help_graphic_driver && return 1 |
[[ -z ${driver} ]] && help_graphic_driver && return 1 |
180 |
|
|
181 |
if [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]] |
if [[ ${driver} = auto ]] |
182 |
|
then |
183 |
|
decho "Using driver autodetection, doing nothing" |
184 |
|
elif [[ -f ${MROOT}/${driverdir}/${driver}_drv.so ]] |
185 |
then |
then |
186 |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/xorg/device/25-device.conf" |
187 |
clearconfig |
clearconfig |
200 |
|
|
201 |
get_graphic_driver() |
get_graphic_driver() |
202 |
{ |
{ |
203 |
local action="$1" |
local action="${CLASS_ARGV[0]}" |
204 |
local driverdir="@@LIBDIR@@/xorg/modules/drivers" |
local driverdir="@@LIBDIR@@/xorg/modules/drivers" |
205 |
local driver |
local driver |
206 |
local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf" |
local config="${MCORE_CONFIG_PATH}/xorg/device/25-device.conf" |