[sugar] G1G1v2 Activities

Douglas Bagnall douglas at paradise.net.nz
Thu Sep 18 19:13:43 EDT 2008


[ this isn't related to 8.2 at all.  greg, please ignore.  :-) ]

one missing piece (for me) in sugar is easy user customization of
the desktop.  in other window managers it's fairly trivial to
create menu items (or toolbar buttons or icons...) that invoke
personal favorites.  under sugar, custom actions are expensive in
that you need to create an activity bundle for every little
one-line shell script you might want to invoke.

thinking about this problem led me to the following pseudo-design,
which i think could be useful in other ways as well.  basically,
i think a single activity bundle should be allowed to represent
multiple activities.

the activity.info file currently specifies the name, icon, command,
etc., for an activity.  this file format could be extended to
allow a single bundle to expose multiple activities:

    [Activity]
    # global information for the bundle.  for backward compatiblity,
    # any name/icon/exec information here would still be honored,
    # and any key/values pairs not supplied by a later section would
    # come from here.
    service_name = com.example.some_multipurpose_activity
    activity_version = 1
    show_launcher = yes
    mime_types = ...some global types...

    [Activity someID]
    # values that are unique for the first "sub-activity"
    name = first-subactivity-name
    icon = clevericon.svg
    exec = /home/olpc/bin/some-command

    [Activity anotherIDstring]
    # values that are unique for the second "sub-activity"
    name = second-subactivity-name
    icon = evenbettericon.svg
    exec = /home/olpc/bin/some-other-command
    mime_types = ...some unique types...

in addition, the commandline specification for the invoked "exec"
commands could/should be extended with one more standard parameter
to the command, which passes the secondary "someID"/"anotherIDstring"
identifiers:  "-i <activity idstring>".  that might eliminate the
need for per sub-activity "exec =" lines in some cases.

uses for this might be to invoke a single activity in two similar
ways (e.g. debug and non-debug modes, during development), or to
simply to reduce the overhead involved in creating small utility
activities -- in my case i tend to create lots of small shell
scripts for myself, all of which could share a bundle.  another
obvious example would be an ssh activity where each iconic instance
on the home screen connected one to a different network host.

one more thing to really make this useful would be the ability to
pass customization text to the icon being displayed (not sure of
the mechanics of this).  picture using this to annotate the icons
in the ssh activity example:  "icon-text = host1" and
"icon-text = host2".  like "name", this could be subject to
localization.

paul
=---------------------
 paul fox, pgf at laptop.org



More information about the Sugar-devel mailing list