Make suspendtimeout for screenlock cutomizable via SXMO_SUSPENDTIMEOUTS
This way if someone wants a longer or shorter timeout that possible by setting the env var SXMO_SUSPENDTIMEOUTS. Also change the default to be 35s. This is roughly the duration of ringing for an incoming phone call.
This commit is contained in:
parent
16d77bcd86
commit
8abe870012
1 changed files with 6 additions and 2 deletions
|
@ -52,6 +52,7 @@ void writefile(char *filepath, char *str);
|
|||
// Variables
|
||||
Display *dpy;
|
||||
enum State state = StateNoInput;
|
||||
int suspendtimeouts = 35;
|
||||
int suspendpendingsceenon = 0;
|
||||
int suspendpendingtimeouts = 0;
|
||||
KeySym lastkeysym = XK_Cancel;
|
||||
|
@ -298,8 +299,8 @@ readinputloop(Display *dpy, int screen) {
|
|||
}
|
||||
} else if (state == StateSuspendPending) {
|
||||
suspendpendingtimeouts++;
|
||||
// # E.g. after 4s kick back into suspend
|
||||
if (suspendpendingtimeouts > 4) state = StateSuspend;
|
||||
// # E.g. after suspendtimeouts seconds kick back into suspend
|
||||
if (suspendpendingtimeouts > suspendtimeouts) state = StateSuspend;
|
||||
syncstate();
|
||||
}
|
||||
|
||||
|
@ -439,6 +440,9 @@ main(int argc, char **argv) {
|
|||
|
||||
signal(SIGTERM, sigterm);
|
||||
|
||||
const char* suspendtimeouts_str = getenv("SXMO_SUSPENDTIMEOUTS");
|
||||
if (suspendtimeouts_str != NULL) suspendtimeouts = atoi(suspendtimeouts_str);
|
||||
|
||||
const char* rtcwakeinterval = getenv("SXMO_RTCWAKEINTERVAL");
|
||||
if (rtcwakeinterval != NULL) wakeinterval = atoi(rtcwakeinterval);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue