How To Start Up a Network Shared Powerpoint on a Raspberry Pi on Boot

For this tutorial, we will be using a Raspberry Pi 2 Model B V1.1 with the 2016-09-23 release of Raspbian with PIXEL. Which can be downloaded via a torrent here. Assuming we are starting from a fresh install, there should be minimal veriances. Everything we do in this tutorial, will be done in Terminal.

 

1. Disable LXDE (the GUI) from blanking the screen or going to a screensaver.

There are multiple ways of doing this, but since we are going to be working in the "autostart" file anyway, so I find this way to be the easiest. These commands can be run at any time, but we will put them in the autostart file of LXDE to execute the upon startup.
Add all three of the following lines to the end of the autostart file, using nano or whatever other text editor you prefer. For an alternate method, check out this tutorial.

Open the autostart file in nano by typing this.

sudo nano /etc/xdg/lxsession/LXDE/autostart

Next, add these three commands in any blank space at the end of the file as shown below.

@xset s noblank

@xset s off

@xset -dpms

noblank tells X server to not blank the video device
xset s disables the screensaver
xset -dpms disables DPMS (Display Power Management Signaling)

 

2. Mount network share on boot using fstab file      

Create a folder in your home directory by typing the command below. Change YOURFOLDERNAME to something appropriate. I just called mine "powerpoint".

mkdir /home/pi/YOURFOLDERNAME

After that, open the file FSTAB with nano by typing this.

sudo nano /etc/fstab

At the end of the file, add the line below. And of course, change the YOURNETSHARE and YOURFOLDERPATH to your specific locations.

//YOURSERVER/YOURNETSHARE /home/pi/YOURFOLDERPATH cifs username=YOURUSERNAME,password=YOURPASSWORD,noauto,x-systemd.automount

This is that mine looked like.

//192.168.11.12/docs/powerpoint /home/pi/powerpoint cifs username=admin,password=password,noauto,x-systemd.automount

A great tutorial on this step can be found here.

 

3. Create a 10 second delay to allow for the network drive to mount   

If you don't do this step, LibreOffice will error out saying that it can't find the file. There may be a better way to do this, but I just created a file with a 10 second delay that executes the PPT and it looks like this:

#!/bin/bash

sleep 10

libreoffice --show powerpoint/YOURFILE.ppt

I saved this file in my /home/pi directory, and called it "powerpoint.sh".

A great tutorial on the delay file can be found here.

 

4. Add command to start the delay file to the autostart

Open the following file in nano like we did in the previous steps:

~/.config/lxsession/LXDE-pi/autostart

Add this line to the end of the file to execute the delay file you created in step 3.

@bash powerpoint.sh

This command ties it all together. Now, save, restart and test it out!

Tutorial Tags: