how to add autostart for xscreensaver for the touch display?

hi, i tried a while to make the display fade to black after a certain time of inactivity. one can manually turn off the backlight, but thats not what i wanted and the only solution working for me finally was to install xscreensaver and set it to “blank screen only”. that works fine when xscreensaver is started manually via ssh after boot. so now i want to run xscreensaver automatically at startup. i tried starting it from rc.local (which i first had to activate) as user volumio (since xscreenserver its not supposed to be run as admin), but systemctl status rc-local.service tells me xscreensaver: 18:25:46: warning: $DISPLAY is not set: defaulti....0". xscreensaver: 18:25:46: Can't open display: :0.0 xscreensaver: 18:25:46: running as volumio/volumio (1000/1000) xscreensaver: 18:25:46: Errors at startup are usually authoriz...ems. But you're not logging in as root (good!) so something else must be wrong. so what can i do to start xscreensaver automatically at startup? i am using volumio-2.011 with the display plugin at an rpi3 with hifiberry and official touch display.

starting xscreensaver manually after boot, however, does exactly what i want…

[FYI] to get it run manually without autostart, you can do the following: log in via ssh and install xscreensaver: sudo apt-get install xscreensaver since xscreensaver-demo did not run, i started xscreensaver and it opens up on the touch display, where you can touch on settings (or something similar, I dont remember exactly) and you get the familiar gui. anyway, my fingers were not tiny enough to touch up and down arrows etc pp, so I just left the gui. with this first run, a file .xscreensaver was created in your home directory, which can be editted manually via ssh nano ~/.xscreensaver i think that the important settings are timeout: 0:01:00 lock: False dpmsQuickOff: True mode: blank selected: -1 if you now run xscreensaver & manually, then your display should now fade after 1 min and reappear when you touch it.

Thank you for the detailed info. I installed xscreensaver and ran into similar problems. I can start it via ssh or from a console at the second desktop but it will not work after a reboot.
Any suggestions to make it work after a restart? Are there alternatives that wil work with the Raspberry Pi 3 and the official touch display?

here is a solution:
screentimeout-rpi-touchscreen-t5059.html
not with xscreensaver but it’s working…