DDC/CI for turning off the screen (instead of HDMI DPMS)
I've solved it using DDC/CI protocol, with ddcutil tool.
Example run commands:
ddcutil setvcp D6 0x02; sleep 10s; ddcutil setvcp D6 0x01
Warning: this bypasses X server and wayland compositor, and therefore reset back to 0x01 needs to be handled manually. The example command resets it back after waiting for 10s. Just, make sure you copy paste the full command as one-liner.
Full kiosk setup
For auto-off based on idle detection, I've created a script based on this answer (see it for getIdle):
#!/bin/bash idle=false idleAfter=90000 while true; do idleTimeMillis=$(./getIdle) if [[ $idle = false && $idleTimeMillis -gt $idleAfter ]] ; then i3lock -c 000000 & ddcutil setvcp D6 0x02 idle=true fi if [[ $idle = true && $idleTimeMillis -lt $idleAfter ]] ; then ddcutil setvcp D6 0x01 sleep 3s pkill i3lock idle=false fi sleep 0.1s done
And, I created ~/.config/lxsession/LXDE-pi/autostart for auto starting all things:
@lxpanel --profile LXDE-pi @pcmanfm --desktop --profile LXDE-pi @/path/to/idle-monitor.sh @chromium-browser http://url-of-the-fullscreen-app/ --kiosk --noerrdialogs --disable-infobars --no-first-run --enable-features=OverlayScrollbar --start-maximize
Notes:
- I added
i3lock (because it's simple), and sleep 3s before killing it, to prevent registration of touches in the chromium until display slowly comes back on, - kiosk setup above is for X backend and not Wayland.