08-06-2021, 11:03 AM
(This post was last modified: 08-06-2021, 11:05 AM by ragreenburg.)
(08-01-2021, 06:29 AM)DrPlamsa Wrote: Here, I'll discuss what I've already accomplished. I found that systemd timers can wake up the PinePhone from suspend/crust. For testing purposes, I've used sytemd-run rather than making new .timer and .service files, because of its simplicity. Here's my one-line command which sets a wake timer:For what it's worth, I think xdotool doesn't work because it doesn't work on Wayland and Phosh uses Wayland. But also, if you happen to find something like xdotools for wayland I would love to hear about it because I just need a single right click but usb tethering isn't working for me so I am just stuck waiting until the next kernel upgrade which hopefully fixes it.
sudo systemd-run --unit='WakeTimer' --on-active=1 --on-unit-active='30m' --timer-property='AccuracySec=1s' --timer-property='WakeSystem=true' /bin/sh -c "date >> /home/[user]/Desktop/MyWakeLog.txt"
So, what is supposed to happen?
1) After 5 minutes, the PinePhone goes into suspend/crust
2) After 30 minutes, the PinePhone wakes up, automatically checks email and chats, and serves any notifications
3) After 5 minutes, the PinePhone goes back into suspend/crust to save battery
Here's what actually happens:
1) After 5 minutes, the PinePhone goes into suspend/crust
2) After 30 minutes, the PinePhone wakes up!
3) The screen stays on, and it never goes back into suspend/crust
4) The battery runs down and it dies
So, does anyone know of either a way of fixing my existing incomplete solution, or a better way of implementing this behavior?
I've tried using xdotool to send a key press, in the hope that this will reset the idle timer and allow the phone to re-suspend after 5 minutes, but xdotool does not seem to actually produce any results on the PinePhone. I've tried using gdbus to call the org.gnome.Mutter.IdleMonitor.GetIdletime method, which works on my desktop but on the PinePhone returns "Not supported." I've tried using gdbus to call the org.gnome.Mutter.IdleMonitor.ResetIdletime method, but this method apparently requires a specific compiler directive to work.
Thanks for your attention and input