That is a good step!
Try this that does the following
– Set the user/group as Volumio
– Ensure Volumio core is up
[Unit]
Description=Screensaver
After=network.target
After=local-fs-pre.target
After=graphical.target
Requires=volumio.service
[Service]
Environment=DISPLAY=:0
User=volumio
Group=volumio
Type=simple
Restart=always
ExecStart=/usr/bin/screensaver2.sh
[Install]
WantedBy=graphical.target
#!/bin/bash
# These should not longer be required
#sleep 60
#export HOME=/home/volumio
#export DISPLAY=:0
#Path to photos
PHOTO_FOLDER=/mnt/LocalHDD/Pictures
while true; do
if volumio status | grep -q ': "play",'; then
# Playing
pidof feh && pkill feh
else
# Stopped
if ! pgrep -x "feh" >/dev/null; then
DISPLAY=:0 feh -ZXYrzFD 10 $PHOTO_FOLDER &
fi
fi
sleep 11s
done