View Single Post
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#4
Thank you for your answers!

I got a simple script working with python-dbus.

After a little research on the web, it seems that dbus-sent does not permit empty containers or nested containers (e.g. arrays of variants), what Notify needs as arguments.
Because I wanted this to write with a python script anyway I gave python-dbus a try, so here it is:
Code:
#!/usr/bin/python
import dbus

bus = dbus.SessionBus()
object = bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications')
interface = dbus.Interface(object,'org.freedesktop.Notifications')
#print(interface.GetCapabilities())

interface.Notify("app_name",
                 0,
                 "/usr/share/icons/hicolor/86x86/apps/harbour-tidings.png",
                 "Here is the title",
                 "and here the body",
                 dbus.Array(),
                 dbus.Array(),
                 0)
If you set the icon-path it shows the notification on the event screen and the icon on the lock screen.


Last edited by EmaNymton; 2014-01-08 at 08:53.
 

The Following 20 Users Say Thank You to EmaNymton For This Useful Post: