pythonnotificationspynotify

How can I read the title, text and icon name from a pynotify.Notification?


If I have a pynotify.Notification object like:

n = pynotify.Notification('title', 'content', 'icon')

How can I read the title (to give 'title'), the text body (to give 'content') and the icon (to give 'icon')?


Solution

  • In [72]: n = pynotify.Notification('title', 'content', 'icon')
    
    In [73]: n.props.summary
    Out[74]: 'title'
    
    In [75]: n.props.body
    Out[75]: 'content'
    
    In [76]: n.props.icon_name
    Out[77]: 'icon'