diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-16 09:53:35 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-16 09:53:35 (GMT) |
commit | 61765e0aaae479b94a3fddd01e4e12eae76bb8da (patch) | |
tree | 4c00c5555c77d70db6bd8cae2768d365d12c6702 /commands/run | |
parent | 76d6fad87094008bc25e3b4e090fb79631414fec (diff) |
Move the remaining scripts to commands
Diffstat (limited to 'commands/run')
-rwxr-xr-x | commands/run | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/commands/run b/commands/run index b1f76aa..0b485b5 100755 --- a/commands/run +++ b/commands/run @@ -1,9 +1,40 @@ -#!/usr/bin/python +#!/bin/bash -import common -import sys +commandsdir=`dirname "$0"` +helpersdir=$commandsdir/helpers +rootdir=`dirname "$commandsdir"` +display=`$helpersdir/find-free-display` -from devbot import run +if [ -f $rootdir/config ]; then + source $rootdir/config +fi -common.setup() -run.run(sys.argv[1:]) +if [ -n $SUGAR_DISPLAY ]; then + SUGAR_XKBCONFIG=`mktemp -t sugar-xkbconfig-XXXXXX` + setxkbmap -print > $SUGAR_XKBCONFIG + export SUGAR_XKBCONFIG +fi + +if [ ! -z $SUGAR_PROFILE ]; then + grep -q PROFILE $rootdir/config + if [ $? -eq 1 ]; then + randomstring=`</dev/urandom tr -cd A-Za-z0-9 | head -c10` + echo "PROFILE=$randomstring" >> $ROOT_DIR/config + fi +fi + +if [ -z $DISPLAY ]; then + tty_num=`tty | grep -oE '[0-9]+$'` + x_options="vt$tty_num" + + xinit $helpersdir/xinitrc -- $display $x_options +else + screen_dpi=`$helpersdir/get-screen-dpi` + xephyr_options="-dpi $screen_dpi" + + if [ -z $RUN_IN_WINDOW ]; then + xephyr_options="$xephyr_options -fullscreen" + fi + + xinit $helpersdir/xinitrc -- /usr/bin/Xephyr $display $xephyr_options +fi |