OLPC XO Opera browser as Sugar activity

Bert Freudenberg bert at freudenbergs.de
Thu Jun 26 02:37:26 EDT 2008


Am 26.06.2008 um 00:49 schrieb Stevens:

> Hi Bert, all,
>
> I changed the script (OperaActivity.py) posted on the wiki (http://wiki.laptop.org/go/Opera 
> ).
>
> This is the old script:
>
>> import logging
>> from sugar.activity import activity
>>
>> import sys, os
>> import gtk
>>
>> class OperaActivity(activity.Activity):
>>
>>    def __init__(self,handle):
>>        activity.Activity.__init__(self,handle)
>>
>>        self.set_title('Opera Activity')
>>
>> 	os.system('opera -notrayicon &')
>
>
> The above script resulted in the 'blank screen' activity. I added a  
> personaldir switch, shown below:
>
> import logging
> from sugar.activity import activity
>
> import sys, os
> import gtk
>
> class OperaActivity(activity.Activity):
>
>    def __init__(self,handle):
>        activity.Activity.__init__(self,handle)
>
>        self.set_title('Opera Activity')
>
> 	os.system('opera -notrayicon -personaldir $SUGAR_ACTIVITY_ROOT/data  
> &')
>
> (The only change is in the last line: added personaldir command line  
> switch.)
>
> This resulted in progress. Now, in addition to the blank screen  
> activity, it starts Opera.
>
> However, this may not have been the right thing to do, or I may need  
> to make some additional changes as there is still a bug: two glyphs  
> show up in the activity circle, one the Opera glyph which when  
> clicked on goes to a blank screen, and the other (a gray circle)  
> which when clicked on goes to Opera. (Before I made the change to  
> the script just the blank screen activity started.)
>
> Is the change I made correct for this case? And, is there some other  
> change I should make to eliminate the 'blank screen' being started?


Sure. Do not use the Python script. You don't want to run a Python  
activity but a native one - otherwise you get two windows, the empty  
one opened by Python and the real one by Opera. Instead, you only need  
a tiny shell script that preloads a little library, which may work  
with Opera:

http://lists.laptop.org/pipermail/devel/2008-January/009387.html

And since you're investigating this, what would be great is if you  
could re-package Opera as a real activity. That means, just move the  
Opera files that are normally installed in the system into the bundle  
itself, and setup the environment in the shell script so it works from  
that non-standard directory. Then zip up the activity directory,  
rename to .xo, and we have a real Opera bundle :) That way it would  
also survive a system upgrade which erases all manually installed RPMs.

- Bert -





More information about the Devel mailing list