Skip to content

Instantly share code, notes, and snippets.

@loopymonkey
Last active August 29, 2015 14:05
Show Gist options
  • Save loopymonkey/9bebc889fbdbfb4a7564 to your computer and use it in GitHub Desktop.
Save loopymonkey/9bebc889fbdbfb4a7564 to your computer and use it in GitHub Desktop.
pi_player_loop
#!/bin/bash
# Raspberry pi video player loop
# Ross Jeffcoat 2012
# requires omxplayer installed
#clears the screen
clear
#mount usb thumb drive - make sure /media/usbstick/ is already created in root
mount -t vfat -o rw /dev/sda1 /media/usbstick/
#loops omxplayer for playlist.mp4 just rename to your file
SERVICE ='omxplayer'
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo 'running' # sleep 1
else
clear && tput cup 50 50 && omxplayer -o hdmi /media/usbstick/videos/playlist.mp4 > /dev/null
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment