balena-io-experimental / browser

A drop-in web browser block
99 stars 77 forks source link

Added the ability to sent custom options to the "xset" command #104

Open Zebble opened 2 years ago

Zebble commented 2 years ago

This should allow more granular control of dpms and other xset options.

The full commandset for xset is available, as this just sends whatever you specify in the XSET_COMMAND to the xset command in startx.sh.

ghost commented 2 years ago

An error occurred whilst building your landr site preview:

{
  "name": "Error",
  "message": "Command failed with code undefined: /usr/src/app/node_modules/gatsby/cli.js build",
  "stack": "Error: Command failed with code undefined: /usr/src/app/node_modules/gatsby/cli.js build\n    at Object.exports.run (/usr/src/app/lib/build-runner.js:257:11)\n    at async build (/usr/src/app/bot/index.js:132:19)\n    at async /usr/src/app/bot/index.js:210:25\n    at async Promise.all (index 0)\n    at async middleware (/usr/src/app/node_modules/@octokit/webhooks/dist-node/index.js:355:5)"
}
Zebble commented 2 years ago

Merged latest master.

Zebble commented 2 years ago

Any chance of getting this PR committed @phil-d-wilson ?

bbugh commented 1 year ago

I need this as well for a "kiosk" that will be largely inactive until users interact with the device. Is there anything I can do to support getting this merged @phil-d-wilson? Thank you!

phil-d-wilson commented 1 year ago

@bbugh @Zebble

I'll definitely try. FYI I stepped up to co-CEO this time last year, so I've been rather busy focusing at the organisational level for a while. But, best effort, I want to enable people using this block.

Has anyone tested these changes? And on what devices?

Thanks! Phil

bbugh commented 11 months ago

@phil-d-wilson congratulations, I'm happy for you and/or sorry that happened. 😂

I have tested the changes now and this branch does solve the problem @Zebble brought up of shutting down the screen at a configured time, and that solves the better half of our problem as well.


The XSET_COMMAND is pretty specific though, I wonder if it wouldn't be better as a two-parter:

  1. a DISABLE_SCREENSAVER (or something) command that prevents xset s off -dpms from running
  2. some way for users to add insert a custom script.

RE: # 2 - I've found all of the balena blocks to be awesome 🎉 but also hard to customize when necessary because so much heavy lifting is done in ENTRYPOINT and we can't safely/smartly override that.

We also need to do additional customization for xscreensaver because for usability's sake we don't want the screen to just shut off immediately, we want it to show an animated screensaver first. Short of copying startx.sh locally and overwriting it or inserting something with sed, I'm not seeing a way to easily do this. Some implementation ideas:

bbugh commented 7 months ago

For what it's worth, we've been running sed in the Dockerfile to replace the line and it's worked fine. Not ideal or future proof, but functional.

RUN sed -i 's/xset s off -dpms/xset s off dpms 3600 10800 21600/' /usr/src/app/startx.sh