In this article, we're building a picture frame using a Raspberry Pi and a regular screen.
/etc/fstab
to mount the network share. Skip this step if using a local directory.host:/export/media /export/media nfs4 auto 0 0
Replace host:/export/media
with your host and export name. See x.antiguru.de for NFS exports.
picframe.sh
in /home/pi
. Update myfolder
to point to the correct location.#!/bin/bash myfolder="/export/media/picframe" if [ -d "$myfolder" ]; then if [ $(tty) == /dev/tty1 ]; then find -L "$myfolder" -name *.jpg -type f -print |shuf > /home/pi/pic1.list while [ true ] do # check if network share still exists if [ ! -d "$myfolder" ]; then exit 1 fi find -L "$myfolder" -name *.jpg -type f -print |shuf > /home/pi/pic2.list & fbi -a -t 90 --noverbose --noreadahead --list /home/pi/pic1.list # this is a hack so after fbi crashes (which it will) the same list isn't # shown again from the start # check if network share still exists if [ ! -d "$myfolder" ]; then exit 1 fi find -L "$myfolder" -name "*.jpg" -type f -print |shuf > /home/pi/pic1.list & fbi -a -t 90 --noverbose --noreadahead --list /home/pi/pic2.list done fi fi exit 0
chmod u+x picframe.sh
fbi
: sudo apt update
, sudo apt upgrade
, sudo apt install fbi
sudo raspi-config
~/picframe.sh
to /home/pi/.bashrc
sudo raspi-config