Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Langhoff <martin@laptop.org>2012-05-22 13:40:52 (GMT)
committer Martin Langhoff <martin@laptop.org>2012-05-23 19:38:06 (GMT)
commitf9267643cfe57bb71994f15d36ba90afc37b5d7b (patch)
tree48d1150aff02d6c39725c6b4433ff4ad58e1be4a
parent5d6834fe62014f573fcf0863ae4883ac9299657c (diff)
welcome_activity module -- customize welcome activity images #11816
-rw-r--r--modules/sugar_welcome_activity/README38
-rw-r--r--modules/sugar_welcome_activity/defaults.ini2
-rw-r--r--modules/sugar_welcome_activity/kspost.77.nochroot.replace_images.py18
-rw-r--r--modules/sugar_welcome_activity/kspost.78.welcome_cmd.py16
4 files changed, 74 insertions, 0 deletions
diff --git a/modules/sugar_welcome_activity/README b/modules/sugar_welcome_activity/README
new file mode 100644
index 0000000..b41faf0
--- /dev/null
+++ b/modules/sugar_welcome_activity/README
@@ -0,0 +1,38 @@
+This module is EXPERIMENTAL and usage may change.
+
+This module allows you auto-start an activity or other program in the
+first Sugar startup -- before the user enters a name and picks icon colors.
+
+By default it will use the Welcome activity -- you MUST have it installed
+for this to work.
+
+It can also
+
+ - Customize the images displayed by the welcome activity.
+
+ - Start a _different_ activity or program.
+
+Take care - this module will also let you break the Welcome activity.
+
+Basic configuration -- just put an empty section(ensure you
+are including the Welcome activity!):
+
+ [sugar_welcome_activity]
+ # nothing here, magic defaults
+
+Advanced configurations:
+
+ Changing welcome images
+
+ [sugar_welcome_activity]
+ images_path=/home/myuser/welcome-images
+
+ Using a different activity
+
+ [sugar_welcome_activity]
+ welcome_screen_cmd=python /home/olpc/Activities/MyCustomWelcome.activity/activity.py
+
+ Using a different program
+
+ [sugar_welcome_activity]
+ welcome_screen_cmd=/usr/bin/someprogram --option parameter
diff --git a/modules/sugar_welcome_activity/defaults.ini b/modules/sugar_welcome_activity/defaults.ini
new file mode 100644
index 0000000..c7d9ac9
--- /dev/null
+++ b/modules/sugar_welcome_activity/defaults.ini
@@ -0,0 +1,2 @@
+[sugar_welcome_activity]
+welcome_screen_cmd=python /home/olpc/Activities/Welcome.activity/activity.py
diff --git a/modules/sugar_welcome_activity/kspost.77.nochroot.replace_images.py b/modules/sugar_welcome_activity/kspost.77.nochroot.replace_images.py
new file mode 100644
index 0000000..d5e4d71
--- /dev/null
+++ b/modules/sugar_welcome_activity/kspost.77.nochroot.replace_images.py
@@ -0,0 +1,18 @@
+# NOTE: Order matters - this script must run after activity unpacking (currently 75)
+# and before welcome_cmd
+import ooblib
+import os, sys
+from pipes import quote
+
+images_path=ooblib.read_config('sugar_welcome_activity', 'images_path')
+
+if images_path:
+ if not os.path.exists(images_path):
+ print >> sys.stderr, "ERROR: sugar_welcome_activity.images_path must point to an existing directory in your build environment"
+ sys.exit(1)
+
+ # synchronize the files within the path, keeping directory structure
+ print 'rsync -rlpt %s/ "$INSTALL_ROOT/home/olpc/Activities/Welcome.activity/images/"' % quote(images_path)
+ # note - chown happens in kspost.80.wecome_cmd as it reads /etc/passwd
+ print 'chmod -R u+rwx "$INSTALL_ROOT/home/olpc/Activities/Welcome.activity/images/"'
+
diff --git a/modules/sugar_welcome_activity/kspost.78.welcome_cmd.py b/modules/sugar_welcome_activity/kspost.78.welcome_cmd.py
new file mode 100644
index 0000000..5853e0b
--- /dev/null
+++ b/modules/sugar_welcome_activity/kspost.78.welcome_cmd.py
@@ -0,0 +1,16 @@
+# NOTE: Order matters - this script must run right after replace_images
+# and before custom_scripts (currently at 80)
+import ooblib
+from pipes import quote
+
+welcome_screen_cmd=ooblib.read_config('sugar_welcome_activity', 'welcome_screen_cmd')
+images_path=ooblib.read_config('sugar_welcome_activity', 'images_path')
+
+if welcome_screen_cmd:
+ print 'mkdir -p /home/olpc'
+ print 'echo %s > /home/olpc/.welcome_screen' % quote(welcome_screen_cmd)
+ print 'chown olpc:olpc /home/olpc/.welcome_screen'
+ print 'chmod u+w /home/olpc/.welcome_screen'
+
+if images_path:
+ print 'chown -R olpc:olpc /home/olpc/Activities/Welcome.activity/images/'