[Dextrose] Send Notification at sugar start up

Esteban Bordon ebordon at plan.ceibal.edu.uy
Fri Mar 4 11:48:22 EST 2011


It's works, but I want to show different messages and I want to show them
only for a few days.

Maybe I could read the messages from a text file.

Thank you guys!

 Esteban


2011/3/4 Martin Abente <martin.abente.lahaye at gmail.com>

> Hello Esteban!
>
> Did you try this?
>
> diff --git a/bin/sugar-session b/bin/sugar-session
> index cc8358c..c9d8a65 100755
> --- a/bin/sugar-session
> +++ b/bin/sugar-session
> @@ -95,8 +95,9 @@ def unfreeze_dcon_cb():
>
>  def setup_frame_cb():
>     logging.debug('STARTUP: setup_frame_cb')
> -    from jarabe import frame
> -    frame.get_view()
> +    from jarabe.frame import get_view
> +    frame = get_view()
> +    frame.add_message('this is a test')
>
>  def setup_keyhandler_cb():
>     logging.debug('STARTUP: setup_keyhandler_cb')
>
> On Thu, Mar 3, 2011 at 10:24 AM, Esteban Bordon
> <ebordon at plan.ceibal.edu.uy> wrote:
> >
> > Hi all,
> >
> > I want to show a simple notification when sugar starts up.
> >
> > I have a python script like this:
> >
> > import dbus
> > BUS_NAME = 'org.freedesktop.Notifications'
> > OBJ_PATH = '/org/freedesktop/Notifications'
> >
> >
> > IFACE_NAME = 'org.freedesktop.Notifications'
> > bus = dbus.SessionBus()
> > notify_obj = bus.get_object(BUS_NAME,OBJ_PATH)
> > notifications = dbus.Interface(notify_obj,IFACE_NAME)
> > notifications.Notify("HelloWorld",0,'',"Summary","Body",[],{},-1)
> >
> >
> >
> > The script works fine, but I couldn't run it at sugar start up. I tried
> to call the script in .xsession and sugar-session but didn't work.
> >
> >
> >
> > Any idea?
> >
> > Thanks,
> > Esteban.
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20110304/80981077/attachment.html>


More information about the Dextrose mailing list