Bug 392525

Summary: Add power option to wake from sleep/suspend
Product: [Frameworks and Libraries] frameworks-solid Reporter: Mark <markg85>
Component: generalAssignee: Unassigned bugs <unassigned-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: jpetso, kde, kdelibs-bugs-null, lukas, natalie_clarius, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Mark 2018-03-30 14:50:52 UTC
Hi,

As far as i know there is currently no abstract way to "set an alarm" using the RTC to wake the pc up at a given time.

There are low-level options like writing directly into /sys/class/rtc/rtc0/wakealarm or slightly less lower level by using systemd https://www.freedesktop.org/software/systemd/man/systemd.timer.html.

These options, while they work, are too low level to be really useful for an user application.

A usecase i'm thinking of is an application like KAlarm, they have to go through the hoops of writing to the rtcwake command: https://cgit.kde.org/kalarm.git/tree/src/rtcwakeaction.cpp They have to ask permission (as you need root to do that) making it all just not as user friendly as it should be.

Therefore i'm requesting a feature in solid to set a "wakeAlarm" (or "rtcwake" or some other logical name) based on a ISO 8601 time string. 


Cheers,
Mark
Comment 1 Mark 2018-03-30 15:49:55 UTC
To add a little to this.

It's not as easy as just adding a method that writes to wakealarm. The datetime you get as input needs to be translated to whatever the RTC clock timezone is. You cannot use QDateTime::currentDateTime(); as that returns the localtime according to /etc/localtime (i think). So for example, in my case my localtime is set to Europe/Amsterdam but my RTC is set to UTC (at this very moment, that is a 2 hour difference). So you need to have the clock time without the UTC offset applied and you need to know which UTC offset would have been applied (for translating input time to RTC time).

There are a few ways to get that information (that i know of).
1. timedatectl
2. hwclock --debug
3. cat /proc/driver/rtc tells you the RTC time, but not the UTC offset (1 and 2 do tell you that)
Comment 2 Jakob Petsovits 2023-12-26 18:37:43 UTC
Reassigning components: The initial comment is requesting this feature for Solid (as API for applications to use, the way I'm reading it) so it's better off in the frameworks-solid product than systemsettings/kcm_powerdevil.