Script for Continuous Running Presentation

A home for all kinds of Puppy related projects
Post Reply
Message
Author
User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

Script for Continuous Running Presentation

#1 Post by steve_s »

I would like to have a script that runs via puppy and shows a pdf file, then another, then a movie, then a pdf, etc.

How can I set up a script to run this continuously until I tell it to stop? i just barely know basic bash scripting, but I don't know how to tell it to run in a loop/continuously till I tell it to stop...

Suggestions? I plan on having a laptop hooked into a tv doing a presentation continuously till I tell it to stop...

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

/usr/bin/myplayer

Code: Select all

#!/bin/bash

#-- this is a endless loop --
while [ 1 ];do

  echo "Hit CTRL-C to exit the loop!"

  #-- run application 1 --
  leafpad

  #-- run application 2 --
  rxvt

  #-- add others here --

done
Instead of leafpad and rxvt you could start your mediafiles with epdfview or other utilities.

You could run it from a console, and stop with CTRL-C.

Or run it from a "grafical utility":

/usr/bin/myplayercontrol

Code: Select all

#!/bin/bash

#-- run the player as backgroundprocess --
myplayer &

#-- get the process ID of the player process --
pid=$!

#-- grafical interface --
xmessage -title "player" -buttons "stop" "
 click on \"stop\" to stop the presentation!
"

#-- stop the player --
kill -9 $pid
Please tell me if it does not work, I did not check the scripts.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#3 Post by steve_s »

thanks, Mark, that should be the basics that get me going...once again, you rock. 8)

One more question though: I realize that if I open something like a pdf viewer I will then want to close it. Things like mplayer aren't as big an issue as they will end once the movie ends, but how to I stop the pdf viewer? Something like 'killall'? Is that the best way?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

maybe like this:

Code: Select all

epdfview /root/pdf1.pdf &
pid=$!
sleep 20
kill $pid
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

Post Reply