Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Touch dbus extensions?

    OS
    5
    10
    1974
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vandys last edited by

      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!)

      DanChapman Flohack 2 Replies Last reply Reply Quote 0
      • DanChapman
        DanChapman @vandys last edited by

        @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.

        Support Dekko development: https://www.patreon.com/dekkoproject

        1 Reply Last reply Reply Quote 1
        • D
          doniks last edited by

          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.

          DanChapman 1 Reply Last reply Reply Quote 1
          • DanChapman
            DanChapman @doniks last edited by

            @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.

            Support Dekko development: https://www.patreon.com/dekkoproject

            V 1 Reply Last reply Reply Quote 0
            • V
              vandys @DanChapman last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • Flohack
                Flohack @vandys last edited by

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

                BR

                My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                V 1 Reply Last reply Reply Quote 0
                • V
                  vandys @Flohack last edited by

                  @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.

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    vandys @vandys last edited by vandys

                    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?

                    1 Reply Last reply Reply Quote 0
                    • V
                      vandys last edited by

                      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.

                      E 1 Reply Last reply Reply Quote 0
                      • E
                        ernest @vandys last edited by

                        @vandys
                        For record purpose :
                        https://docs.ubuntu.com/phone/en/platform/guides/push-notifications-server-guide
                        https://github.com/BigET/NotificationPost

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post