Touch dbus extensions?



  • Can somebody point me at the Touch specific extensions to dbus, in particular their Notification messages? With that I can hopefully code up a quick-and-dirty shim from my existing messaging server using UDP onto system notifications. That'll let me try a UBports phone as a daily driver until I can pursue proper HTML5 notifications. (TIA!)



  • @vandys The server guide to the push notification service is here which has example dbus calls. com.ubuntu.Postal.Post is the one you want. The postal service handles the popup notification, persistent notification entry in the messaging menu and adjusting the launcher count.



  • I'm not sure whether this actually answers your question, but I have two things come to my mind:

    Firstly, you can install libnotify-bin and it just works like this:

    sudo mount -o rw,remount /
    sudo apt update
    sudo apt-get install libnotify-bin
    notify-send -- asdf jkl
    

    This will pop up a notification box top right. If I remember it right installing this, will also make notifications from desktop apps "just work".

    Secondly, I like to use qdbus to explore available dbus interfaces. For some reason you can't use the qdbus executable that comes first in the path:

    qdbus
    qdbus: could not exec '/usr/lib/arm-linux-gnueabihf/qt5/bin/qdbus': No such file or directory
    

    But when you change the path to use another executable, then it works:

    export PATH=/usr/lib/arm-linux-gnueabihf/qt4/bin:$PATH
    qdbus
    

    now you can just grep and experiment your way through the dbus interfaces. oh and I think I also installed and loaded bash-completion to make the usage of qdbus even more efficient with tab completion.

    Hth!

    DISCLAIMER: Use apt with caution and at your own risk. It HAS brought me into situations where I had to reflash the phone. But if I remember it right only ever after using apt upgrade. Anyway, keep this in mind!

    DISCLAIMER2: I don't apply the path change permanently. It broke something else, but I can't remember what.



  • @doniks just to note libnotify-bin will only show a popup notification. It will not persist in the messaging menu. You would have to use libmessaging-menu if you wanted to do it from code or dig out the dbus api for indicator-messages.



  • Thank you all! This points me straight at the solution, and also I found out about a whole tree of docs which I'll be browsing as time permits.


  • Infrastructure



  • @Flohack said in Touch dbus extensions?:

    @vandys Did you look at this? https://wiki.ubuntu.com/Touch/Notifications

    Yes, but that one didn't have enough detail to code up a notification shim. I was blown away by the documentation in the server guide, including an example dbus CLI invocation.



  • I've been digging through the Platform Guide, trying to get the Postal service to do what I want. As best I can tell, giving it a message using the Postal.Post method simply queues it up for the application--nothing visible happens. If I subsequently use PopAll, I see all the queued messages get drained off.

    But I'm still searching for the dbus listener who will make a user-visible notification, beep the phone, start the message light flashing, that sort of thing. I know that such a thing was intended to go through Canonical's servers, but we all know they're not long for this world. I want to step into the software chain at about the point where the network listener heard from those servers and needed to let the user know.

    (edit) I've set up a build server and just finished assembling about 20GB of build tree. But I don't see any Ubuntu Touch source code, just some prebuilt deb's? Who builds those?



  • Just a note for others wanting to lay hands on the lower levels, this is the dbus command I used to get a notification to appear:

    gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify "notify-send" 0 "" "hi mom3" "blah blah blah" "[]" '{}' 5000

    I'm still digging through the black magic of the "app name". The gdbus call won't work until notify-send has run once, nor will it work with a different app name. Similarly, these notifications are silent; Notifications settings enumerate apps which get to vibrate or make sound, and I guess I have to line up with that in some fashion.


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.