Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README17
-rw-r--r--TODO1
-rw-r--r--scripts/xinitrc16
4 files changed, 29 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 54f2070..e47df0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ logs/*.log
logs/*.tar
logs/all-logs.tar.bz2
scripts/list-outputs
+config
diff --git a/README b/README
index ee7fb8b..60a67f3 100644
--- a/README
+++ b/README
@@ -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
diff --git a/TODO b/TODO
index 94356b1..3549345 100644
--- a/TODO
+++ b/TODO
@@ -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