diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README | 17 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | scripts/xinitrc | 16 |
4 files changed, 29 insertions, 6 deletions
@@ -6,3 +6,4 @@ logs/*.log logs/*.tar logs/all-logs.tar.bz2 scripts/list-outputs +config @@ -70,9 +70,22 @@ send-patches Send local commits as patches for review. Use --help for more informations about each command. -== Environment variables == +== Configuration == -SUGAR_OUTPUT +You can set a few options by creating sugar-build/config. Example + +OUTPUT=HDMI1 +RESOLUTION=1024x768 + +The following options are available + +RESOLUTION + +Specify the screen resolution in the form widthxheight. Note that +the resolution needs to be in the list of available modes, as +displayed by xrandr command. + +OUTPUT Sugar does not run properly on multiple video outputs, so we need to select one and turn off the others. By default we select the first @@ -1,2 +1 @@ * Figure out what to do with shutdown -* Allow to configure resolution (sugarbuildrc?) diff --git a/scripts/xinitrc b/scripts/xinitrc index da89c27..1421396 100644 --- a/scripts/xinitrc +++ b/scripts/xinitrc @@ -7,6 +7,12 @@ unset SESSION_MANAGER SCRIPTS_DIR=`dirname "$0"` ROOT_DIR=`dirname "$SCRIPTS_DIR"` +if [ -f $ROOT_DIR/config ]; then + source $ROOT_DIR/config +fi + +echo $OUTPUT + # Sugar doesn't handle multiple outputs properly. To avoid issues we keep the # first output in the list returned by xrandr and turn off everything else. @@ -15,15 +21,19 @@ OUTPUTS=`scripts/list-outputs` for output in $OUTPUTS do # Default to the first output in the list - if [ -z $SUGAR_OUTPUT ]; then - SUGAR_OUTPUT=$output + if [ -z $OUTPUT ]; then + OUTPUT=$output fi - if [ $SUGAR_OUTPUT != $output ]; then + if [ $OUTPUT != $output ]; then xrandr --output $output --off fi done +if [ -n $RESOLUTION ]; then + xrandr -s $RESOLUTION +fi + if [ -z $SUGAR_SESSION ]; then export SUGAR_SESSION=yes else |