<< Previous | Next >>

Scratchbox Development, a few scripts to make your life easier ...

When developing for the Nokia 770, I use the following scripts to make the process a bit less painful. After you have these in place, just run sbstart in your terminal and off you go. (Assuming you have $HOME/bin in your PATH.)

Any second sbstart in a new shell will put you in the same environment, but logging out of the original will kill all sessions.

file ~/bin/sbstart (chmod 755):

#!/bin/bash

# choose Xephyr or Xvnc ...

#ps xa | grep '[0-9] Xephyr' >/dev/null || \
#    Xephyr :10 -ac -screen 800x480x16 -dpi 96 > /dev/null &

ps xa | grep '[0-9] Xvnc' >/dev/null || \
    Xvnc :10.0 -geometry 800x480 -depth 16 >/dev/null &

export DISPLAY=":10.0"
xhost +

/scratchbox/login bin/sbstart

file ~/bin/sbstart in scratchbox (chmod 755):

#!/bin/bash

. af-sb-init.sh start
bash -l
af-sb-init.sh stop
sb_killall.py

file ~/.bashrc in scratchbox:

export DISPLAY=":10.0"
export LANGUAGE=en_GB
export PAGER=less
export PATH="$PATH:$HOME/bin"

file /scratchbox/tools/bin/sb_killall.py (need root to write to create that file, chmod 755):

#!/usr/bin/env python
#
# Authors: Onne Gorter <onne.gorter@nokia.com>
#
# Licensed under GPL, see COPYING for details.

import os, sys, socket, time

sys.path += [os.path.dirname(os.path.realpath(sys.argv[0])) + "/../lib/python2.3"]

from sb import config

config.killall() # default kill
time.sleep(1) # wait a little
config.killall(9) # kill hard killalble processes

03_770_internet_tablet_lowres.jpg

Happy hacking with the Nokia 770!

Also see:

Last modified: 2007-11-19 20:15 GMT