rodlie / powerkit

Desktop Independent Power Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RTC wakeup

rodlie opened this issue · comments

You can't trust upower/backend to hibernate on low battery while suspended (it did for a while on my thinkpad, but for some reason not anymore, system is unchanged), add a feature to wake up the machine after X amount of time and do a hibernate.

So, I will need to directly write to /sys/class.

Example of wakeup:

date -u --date "2019-04-04 22:57:00" +%s
write to /sys/class/rtc/rtc0/wakealarm

read status from /proc/driver/rtc since cat wakealarm always returns null.

There are two ways to solve this, either suggest a "rule" for ownership of /sys/class/rtc/rtc0/wakealarm to distros, or write a simple powerkitd daemon that can write to wakealarm (and backlight as a bonus) on behalf of powerkit. From a user perspective the last option would be the best, since it will "just work".

I still need to add the options in the config dialog, but the backend for RTC wakeup seems to work ok, I will need to test this over time.

This has already been done and tested for several month in another fork, see #26