Results 1 to 2 of 2

Thread: pynotify question

  1. #1
    Join Date
    Feb 2010
    Location
    Bistrita, Romania
    Beans
    30
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Cool pynotify question

    I have been recently working on a project using pynotify. I want to know if there is any way to set the time the notification is visible ?

    n = pynotify.Notification ("blah blah", "blah blah")
    # for example

    And any member function or something to set the amount of time the notification on befor it closes?
    P.S. Using Ubuntu (GNOME)

  2. #2
    Join Date
    Jul 2006
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: pynotify question

    After initializing your notification object (like you did), use:

    Code:
    n.set_timeout(10000)
    time is in milliseconds.

    You may also be interested in experimenting with the following:

    Set urgency:
    Code:
    n.set_urgency(pynotify.URGENCY_LOW)
    n.set_urgency(pynotify.URGENCY_NORMAL)
    n.set_urgency(pynotify.URGENCY_CRITICAL)
    Set icon:
    Code:
    icon = helper.render_icon(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG)
    n.set_icon_from_pixbuf(icon)

    The pynotify api documentation is close to non-existent. I ran through similar problems a few weeks ago. Good Luck
    Open-source FPS reborn, evolve with us, xonotic.

    RIP Nexuiz - 8) Nexuiz Ninjaz - Practicing the ninja arts of xonotic.
    My Themes: Green and Ruby - Karmic Koala for GNOME | Brown ubuntuforums.org for Stylish

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •