browser icon indicating copy to clipboard operation
browser copied to clipboard

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

Open Zebble opened this issue 3 years ago • 7 comments

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.

Zebble avatar Feb 04 '22 19:02 Zebble

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)"
}

ghost avatar Feb 04 '22 19:02 ghost

Merged latest master.

Zebble avatar Sep 12 '22 18:09 Zebble

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

Zebble avatar Sep 12 '22 18:09 Zebble

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!

bbugh avatar Oct 02 '23 18:10 bbugh

@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

phil-d-wilson avatar Oct 03 '23 10:10 phil-d-wilson

@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:

  • Having it automatically run a specific script location
  • having an environment variable like XORG_STARTUP_SCRIPT that points to a user-customizable entrypoint file that runs right before node
  • More flexible but definitely more work, having multiple "hooks" that look for user-provided files at specific events

bbugh avatar Oct 25 '23 21:10 bbugh

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

bbugh avatar Feb 22 '24 19:02 bbugh