{"id":174,"date":"2018-11-01T20:53:46","date_gmt":"2018-11-02T00:53:46","guid":{"rendered":"http:\/\/bhoey.com\/blog\/?p=174"},"modified":"2020-06-24T18:58:32","modified_gmt":"2020-06-24T22:58:32","slug":"photo-slideshows-using-raspberry-pi","status":"publish","type":"post","link":"https:\/\/bhoey.com\/blog\/photo-slideshows-using-raspberry-pi\/","title":{"rendered":"Photo Slideshows Using Raspberry Pi And feh"},"content":{"rendered":"<h3>Background<\/h3>\n<p>At a family event just shy of a year ago I wanted to set up a slideshow (two in fact) to run continuously. The event was outdoors and leaving two laptops exposed to the elements for an extended period of time was obviously not very appealing. So instead a couple of Raspberry Pis together with the <a href=\"https:\/\/feh.finalrewind.org\/\">feh<\/a> image viewer proved to be the perfect fit.<\/p>\n<h3>System Info<\/h3>\n<p>These instructions assume a fresh install of Raspbian using either <a href=\"https:\/\/www.raspberrypi.org\/documentation\/installation\/installing-images\/README.md\">the official Raspbian imager<\/a> or by using the <a href=\"https:\/\/www.raspberrypi.org\/downloads\/noobs\/\">NOOBS<\/a> installer.<\/p>\n<ul>\n<li>Pi: Raspberry Pi 3<\/li>\n<li>OS: Raspbian 9 (Stretch)<\/li>\n<li>Desktop: LXDE<\/li>\n<\/ul>\n<h3>Feh Installation and Test<\/h3>\n<p>The first step is to install the feh program. Raspbian uses the APT package management so installation is as simple as:<\/p>\n<pre class=\"brush: plain; notranslate\">apt-get install feh\n<\/pre>\n<p>Next, in order to run feh in the way we want, enter the following command in the terminal:<\/p>\n<pre class=\"brush: plain; notranslate\">feh \\\n    --recursive \\\n    --randomize \\\n    --fullscreen \\\n    --quiet \\\n    --hide-pointer \\\n    --slideshow-delay 6 \\\n    yourPicDir\n<\/pre>\n<p>The command line switches are for the most part self-explanatory. The idea is to give feh a directory containing pictures you've copied to the Pi and then have it cycle through them randomly, displaying each for six seconds. Other options are documented in the man pages if you'd like to customize the usage.<\/p>\n<p>To exit the slideshow press the Esc key.<\/p>\n<h3>Disabling Screen Blanking<\/h3>\n<p>By default the screen will blank after a few minutes of mouse and keyboard inactivity. In order to disable the screen blanking we'll need to modify the lightdm.conf file:<\/p>\n<pre class=\"brush: plain; notranslate\">nano \/etc\/lightdm\/lightdm.conf\n<\/pre>\n<p>and add the following line under the [Seat:*] section:<\/p>\n<pre class=\"brush: plain; notranslate\">xserver-command=X -s 0 dpms\n<\/pre>\n<h3>Auto-Start Slideshow On Boot<\/h3>\n<p>To have the slideshow automatically start on boot, first create a small shell script file to hold the feh command:<\/p>\n<pre class=\"brush: plain; notranslate\">nano \/home\/pi\/slideshow.sh\n<\/pre>\n<p>and paste the following:<\/p>\n<pre class=\"brush: plain; notranslate\">#!\/bin\/bash\n\nfeh \\\n    --recursive \\\n    --randomize \\\n    --fullscreen \\\n    --quiet \\\n    --hide-pointer \\\n    --slideshow-delay 6 \\\n    yourPicDir\n<\/pre>\n<p>Be sure to make the new shell script executable:<\/p>\n<pre class=\"brush: plain; notranslate\">chmod 755 \/home\/pi\/slideshow.sh\n<\/pre>\n<p>And finally add it to the pi user's LXDE autostart file:<\/p>\n<pre class=\"brush: plain; notranslate\">echo \"@\/home\/pi\/slideshow.sh\" &gt;&gt; \/home\/pi\/.config\/lxsession\/LXDE-pi\/autostart\n<\/pre>\n<p>When you reboot your Raspberry Pi it should now automatically start the slideshow.<\/p>\n<p>To exit the slideshow, hit the Esc key and you will see the normal LXDE desktop.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At a family event just shy of a year ago I wanted to set up a slideshow (two in fact) to run continuously. The event was outdoors and leaving two laptops exposed to the elements for an extended period of time was obviously not very appealing. Instead a couple of Raspberry Pis together with the feh image viewer proved to be the perfect fit.&nbsp;<a href=\"https:\/\/bhoey.com\/blog\/photo-slideshows-using-raspberry-pi\/\">[Continue&nbsp;reading...] <span class=\"screen-reader-text\">Photo Slideshows Using Raspberry Pi And feh<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":817,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[33,45],"tags":[44,42,43],"_links":{"self":[{"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/posts\/174"}],"collection":[{"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/comments?post=174"}],"version-history":[{"count":20,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/posts\/174\/revisions\/821"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/media\/817"}],"wp:attachment":[{"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bhoey.com\/blog\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}