browser icon indicating copy to clipboard operation
browser copied to clipboard

Ability to enable screensaver/display power down?

Open Zebble opened this issue 3 years ago • 5 comments

We're testing this using KIOSK mode and it works brilliantly. Is there a way to have the screen powered down after a certain amount of time?

Zebble avatar Jan 30 '22 20:01 Zebble

Hey @Zebble - not with this block, but I was going to chat to @rahul-thakoor about making the scheduler service from balena dash into another block, so that projects could use it. I have numerous devices around the house running this browser block, but currently they are on 24/7.

phil-d-wilson avatar Jan 30 '22 20:01 phil-d-wilson

Thanks @phil-d-wilson - I did some digging into the scheduler service and that does seem like it will work by time, but possibly not by activity? (ie. 5 minutes after keyboard/mouse/touchscreen, turn off the screen).

I was able to modify the entrypoint/command through docker-compose for the browser service to do what I think will work for now.

entrypoint: bash
command: -c "(/usr/src/app/start.sh &) && sleep 15 && export XAUTHORITY=/home/chromium/.Xauthority && export DISPLAY=:0 && xset s 600 600 && xset +dpms && while true; do sleep 60; done;"

Zebble avatar Jan 30 '22 20:01 Zebble

Oh NICE!

phil-d-wilson avatar Jan 30 '22 20:01 phil-d-wilson

I made a slight change to my original workaround as this didn't seem to work when rolled out on balenaOS. This command works:

command: -c "(/usr/src/app/start.sh &) && sleep 15 && XAUTHORITY=/home/chromium/.Xauthority DISPLAY=:0 && xset s 600 600 && XAUTHORITY=/home/chromium/.Xauthority DISPLAY=:0 xset +dpms && while true; do sleep 60; done;"

You will want to adjust the "600"'s to whatever screen timeout you need (in seconds).

The only remaining issue is that at least on an LCD touchscreen, touching the screen not only wakes up the screen but acts as an active press on whatever area you happen to touch.

Zebble avatar Feb 03 '22 21:02 Zebble

Hey @phil-d-wilson, added a new XSET_COMMAND option in PR #104 that has worked well for many months. Hope this helps!

Zebble avatar Sep 12 '22 18:09 Zebble