From 61826eaf202df49747a7766a06fb8efdb3754148 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 03 Oct 2008 00:15:25 +0000 Subject: Use a SUGAR_SCALING variable to configure scaling. --- (limited to 'bin') diff --git a/bin/.gitignore b/bin/.gitignore index 9e78b64..b86c1c9 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1 +1,2 @@ +sugar sugar-shell-service diff --git a/bin/sugar b/bin/sugar deleted file mode 100644 index 88e478a..0000000 --- a/bin/sugar +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -export SUGAR_THEME=sugar-xo - -if [ -f /etc/olpc-security ] ; then - exec dbus-launch --exit-with-session --config-file=/etc/dbus-1/session-olpc.conf sugar-shell -else - exec dbus-launch --exit-with-session sugar-shell -fi diff --git a/bin/sugar-emulator b/bin/sugar-emulator index 36958db..f6cafd6 100644 --- a/bin/sugar-emulator +++ b/bin/sugar-emulator @@ -88,27 +88,24 @@ def main(): """Script-level operations""" parser = OptionParser() - parser.add_option('-x', '--xo-style', dest='xo_style', - action='store_true', help='use the XO style') + parser.add_option('-d', '--dpi', dest='dpi', help='Emulator dpi') + parser.add_option('-s', '--scaling', dest='scaling', help='Sugar scaling') (options, args) = parser.parse_args() _setup_env() - if options.xo_style: - _start_xephyr(dpi=201) + if options.dpi: + _start_xephyr(dpi=options.dpi) else: _start_xephyr() - if options.xo_style: - os.environ['SUGAR_THEME'] = 'sugar-xo' - os.environ['SUGAR_XO_STYLE'] = 'yes' - else: - os.environ['SUGAR_XO_STYLE'] = 'no' + if options.scaling: + os.environ['SUGAR_SCALING'] = options.scaling command = ['dbus-launch', 'dbus-launch', '--exit-with-session'] if not args: - command.append('sugar-shell') + command.append('sugar') else: _start_matchbox() diff --git a/bin/sugar-shell b/bin/sugar-shell index a47b556..6a8d112 100644 --- a/bin/sugar-shell +++ b/bin/sugar-shell @@ -18,15 +18,6 @@ import os import gettext -from jarabe import config - -if os.environ.has_key('SUGAR_THEME'): - theme = os.environ['SUGAR_THEME'] -else: - theme = 'sugar' - -os.environ['GTK2_RC_FILES'] = os.path.join(config.data_path, '%s.gtkrc' % theme) - import gtk import gobject import dbus.glib diff --git a/bin/sugar.in b/bin/sugar.in new file mode 100644 index 0000000..26f7cba --- /dev/null +++ b/bin/sugar.in @@ -0,0 +1,14 @@ +#!/bin/sh + +if test -z "$SUGAR_SCALING"; then + export SUGAR_SCALING=100 +fi + +export GTK2_RC_FILES="@prefix@/share/sugar/data/sugar-$SUGAR_SCALING.gtkrc" + +if ! test -f "$GTK2_RC_FILES"; then + echo "sugar: ERROR: Gtk theme for scaling $SUGAR_SCALING not available." + exit 1 +fi + +sugar-shell -- cgit v0.9.1