Request for Intent Listener Feature in KDEConnect Android

There is a feature request to add support in KDE Connect Android for listening to broadcast intents from other apps like Gadgetbridge.

This would allow KDE Connect to automatically run scripts or commands when a specific intent is received. It would enable better automation by letting external apps trigger commands remotely via standard Android intents, improving integration and workflow flexibility.

Would appreciate some user feedback

2 Likes

New user and first post but I would absolutely love this. One area I think is completely untapped is automation on Android, be it via Tasker, Automate or another app having a catalogue of intents available for the KDE app would multiply it’s utility ten fold in my book.

1 Like

Recently I tried to automate sending data from Android to my laptop. It was an extremely frustrating experience and I eventually gave up after two hours. KDE Connect has tons of features and Android has lots of ways for apps to interact with each other, yet this seemed to always be just barely impossible, no matter which method I tried:

  • Clipboard sync is broken in modern Android.
  • Pre-set commands can’t have arguments.
  • The app doesn’t seem to do anything with intents, doesn’t have launcher shortcuts or widgets.
  • KDE’s “media player” tray menu shows the song that’s currently playing on my phone, but I have no idea how to get that from a script. Otherwise I would have created an empty audio file with my data as the file name. (Yes, that’s how desparate I got.)
  • There’s no kdeconnect-cli argument for getting a file from the phone’s storage, only for sending one. Otherwise I could have pulled the same file every few seconds and checked for changes.
  • Using the “share file” feature to send something from another app to KDE Connect still requires a tap on the computer’s name, even if it’s the only entry and it’s already paired anyway.
  • When I started considering killing and restarting the app to send data in Morse code/binary via the device status, I decided that I had gone insane enough and figured out a solution without KDE Connect instead.

Now that I write this, I realise that I can cause a notification with arbitrary text and, after some short research, found…
dbus-monitor --session "interface='org.freedesktop.Notifications',member='Notify'"
…, which lets me read incoming notifications on my laptop and process them with Bash. (dbus-monitor member=Notify might also be enough.)
That’s still not great for sending kilobytes or megabytes of data and anything that’s not text would have to be encoded and decoded, but at least it’s technically possible. My usecase would be to send the hash of files that I’ve sent from my laptop to my phone, so that I can verify that they’ve been transmitted successfully and then delete them from my laptop. So in this case, it would be enough.
But then the next problem is automatically dismissing those notifications on both ends… On Android, it’s easy with MacroDroid. On Linux, the best idea I found so far is to create another notification in a way that I can get its notification ID, then hope that that’s just 1 more than the previous notification (from KDE Connect) and use two commands like this:
qdbus6 org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.CloseNotification 12345
(with the notification ID at the end)
And if it’s not 1 more, then it’s just bad luck and the notification will stay there.
Surely that’s not the best way to send data. In the reverse direction, I can just do kdeconnect-cli --share /path/to/file.txt . Or --send-clipboard or --ping-msg or --share-text or --send-keys or …