02-27-2021, 09:49 AM
Hi,
I've heard that gnome is working on letting gnome-clocks wake up the phone but didn't find anything in that regard.
So i experimented a little bit myself and got it to work with a little dirty hack. I don't really know a lot about the gnome ecosystem, vala, dbus, flatpack etc. so it really is a mess but kinda working.
I first tried to write directly to /sys/class/rtc/rtc0/wakealarm from gnome-clocks when an alarm is changed but it outright refused to. Even with chmod-ing that file. I don't really know why but my guess it's b/c of some flatpack specific stuff.
So i wrote a small external program "waked" which let's other programs register alarms via dbus to wake up the system. It's just a little experiment and still relies on /sys/class/rtc/rtc0/wakealarm being chmodded but better then nothing. Running waked as root didn't work because then the dbus sessions didn't play nicely.
Then i slapped some spaghetti to gnome-clocks to register it's alarms in waked. Really messy, just a poc.
You can find the result here: https://gitlab.com/seath1
waked needs sdbus-cpp to build
What do you think, could that be a step in the right direction? I'm a bit surprised I couldn't find something existing to schedule rtc wakeups other than systemd timers which afaik doesn't let users add their own timers.
I've heard that gnome is working on letting gnome-clocks wake up the phone but didn't find anything in that regard.
So i experimented a little bit myself and got it to work with a little dirty hack. I don't really know a lot about the gnome ecosystem, vala, dbus, flatpack etc. so it really is a mess but kinda working.
I first tried to write directly to /sys/class/rtc/rtc0/wakealarm from gnome-clocks when an alarm is changed but it outright refused to. Even with chmod-ing that file. I don't really know why but my guess it's b/c of some flatpack specific stuff.
So i wrote a small external program "waked" which let's other programs register alarms via dbus to wake up the system. It's just a little experiment and still relies on /sys/class/rtc/rtc0/wakealarm being chmodded but better then nothing. Running waked as root didn't work because then the dbus sessions didn't play nicely.
Then i slapped some spaghetti to gnome-clocks to register it's alarms in waked. Really messy, just a poc.
You can find the result here: https://gitlab.com/seath1
waked needs sdbus-cpp to build
What do you think, could that be a step in the right direction? I'm a bit surprised I couldn't find something existing to schedule rtc wakeups other than systemd timers which afaik doesn't let users add their own timers.