[dbus] Wake up PinePhone regularly to check email and IMs

I’m trying to adapt this script to wake up the PinePhone regularly and check emails and IMs on Plasma Mobile.

Basically this sets a timer to regularly run a shell script that uses DBus to wake the phone.

As far as I can tell, everything should be exactly the same for PlasMo except for the actual DBus calls in DontSuspendOnUnlock.sh and WakeTimer.sh.
Looking at Calendori and KClock, I thought that the way to go was to call PowerDevil via the same kind of DBus command.

So I wanted to try something like the examples commands for KDEConnect, e.g.

qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement org.kde.Solid.PowerManagement.wakeup

but I get qdbus command not found and I don’t see which additional package I should install to use it.

Could somebody point me in the right direction?
Basically:

  • how do I make DBus calls on Plasma Mobile?
  • is the example the correct way to use PowerDevil?

Took me forever but I finally found out that qdbus is provided by qt5-tools.

qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement org.kde.Solid.PowerManagement.wakeup seems to work and I think I might be able to replace the other call by

su [username] -c 'dbus-monitor --address "unix:path=/run/user/1000/bus" "type='signal',interface='org.freedesktop.ScreenSaver'"'

I’ll test it ASAP and report back here

3 Likes

Everything works, I’ll try to provide a clean version somewhere on a git repo in the near future.

EDIT: I made a repo on codeberg with the code I’m using right now.

There are still a few quirks so contributions are welcome.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.