How to send a display to sleep with squareline?

What do you want to achieve?

I want to send a arduino squareline project display to sleep after a given time (5 mins) of inactivity. The Display should restart again, once it is touched. How can this be achieved?

What have you tried so far?

I was thinking of using an inactivity timer and then call a function based on that timer. If the display is touched, the timer is reset.
But I‘m not really sure if this is the best way and where to implement. Also I‘m not sure how to wake it up again.


  • Operating system:
  • Target hardware:
    esp32 s3

Primary this isnt Squareline job. Second question is how type of sleep you plan.
A. backlight only off
B. display controller send sleep cmd
C. full MCU sleep modes

For A you can use squareline uievents for init lvtimer, in it check inactivity

lv_timer_t * timer = lv_timer_create(youreverysecfunc, 1000,  NULL);
void youreverysecfunc(lv_timer_t * timer) {
if(lv_disp_get_inactive_time(NULL) > 5000 )  //for 5 sec