~jpsamaroo/DBus.jl

8513a9822d77e602cc06f9300f058a89920afa90 — Julian P Samaroo 1 year, 22 days ago e971ca7
Add notify-send example
1 files changed, 28 insertions(+), 0 deletions(-)

A examples/notify-send.jl
A examples/notify-send.jl => examples/notify-send.jl +28 -0
@@ 0,0 1,28 @@
using DBus

title, msg = ARGS[1:2]

conn = DBus.connect()

owner = DBus.send_recv!(conn,
                        "org.freedesktop.DBus",
                        "/org/freedesktop/DBus",
                        "org.freedesktop.DBus",
                        "GetNameOwner",
                        ["org.freedesktop.Notifications"])

DBus.send_recv!(conn,
                owner,
                "/org/freedesktop/Notifications",
                "org.freedesktop.Notifications",
                "Notify",
                [
                    "notify-send",
                    UInt32(0),
                    "",
                    title,
                    msg,
                    String[],
                    Dict{String,Ref}[],
                    Int32(-1)
                ])