Handle cron tasks while in crust

mnc goal is to display when will occurs the next cron job.

We drop the "sxmo_screenlock.sh rtc" command and the
SXMO_RTCWAKEINTERVAL variable. We will now only use
"sxmo_screenlock.sh crust" which mean suspend until next cron job
(-2 seconds).

To replicate the old behavior of the blinking phone then returning to
suspension (if needed) we now use a new script.

By example:

*/15 * * * * DISPLAY=:0 sxmo_rtcwake.sh sleep 10

This will trigger a 10s sleep task every 15 minutes (the old default
rtcwake hook).

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
Stacy Harper 2021-06-29 19:19:56 +02:00 committed by Maarten van Gompel
parent 02a37c9dea
commit 0ed27f8538
6 changed files with 54 additions and 107 deletions

View file

@ -9,14 +9,6 @@ ACTION="$1"
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
crust() {
if [ -n "$SXMO_RTCWAKEINTERVAL" ]; then
sxmo_screenlock.sh rtc "$SXMO_RTCWAKEINTERVAL"
else
sxmo_screenlock.sh crust
fi
}
lock_screen() {
if [ "$SXMO_LOCK_SCREEN_OFF" = "1" ]; then
sxmo_screenlock.sh off
@ -24,7 +16,7 @@ lock_screen() {
sxmo_screenlock.sh lock
fi
if [ "$SXMO_LOCK_SUSPEND" = "1" ]; then
crust
sxmo_screenlock.sh crust
fi
}
@ -46,7 +38,7 @@ typeenter() {
if [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then
case "$ACTION" in
"volup_three")
crust
sxmo_screenlock.sh crust
;;
"voldown_three")
if [ "$(sxmo_screenlock.sh getCurState)" = "lock" ]; then