From 1b45e7743db973f9184340829f6cffd72b6e7409 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 10 Aug 2020 13:17:28 +0200 Subject: [PATCH] added SXMO_LOCK_SCREEN_OFF and SXMO_LOCK_SUSPEND environment variables to set a target stage from the environment Signed-off-by: Maarten van Gompel --- programs/sxmo_screenlock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/programs/sxmo_screenlock.c b/programs/sxmo_screenlock.c index 543ac16..a332cd7 100644 --- a/programs/sxmo_screenlock.c +++ b/programs/sxmo_screenlock.c @@ -449,6 +449,12 @@ main(int argc, char **argv) { const char* rtcwakeinterval = getenv("SXMO_RTCWAKEINTERVAL"); if (rtcwakeinterval != NULL) wakeinterval = atoi(rtcwakeinterval); + const char* screen_off = getenv("SXMO_LOCK_SCREEN_OFF"); + if (screen_off != NULL && atoi(screen_off)) target = StateNoInputNoScreen; + + const char* suspend = getenv("SXMO_LOCK_SUSPEND"); + if (suspend != NULL && atoi(suspend)) target = StateSuspend; + //parse command line arguments for (i = 1; i < argc; i++) { if(!strcmp(argv[i], "-h")) {