Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Apr 2014, 13:54
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Script for Continuous Running Presentation
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Tue 07 Apr 2009, 09:08    Post subject:  Script for Continuous Running Presentation
Subject description: Script to play a movie, then show a pdf, then keep going
 

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...
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 07 Apr 2009, 12:00    Post subject:  

/usr/bin/myplayer

Code:
#!/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:
#!/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

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
steve_s


Joined: 26 May 2008
Posts: 1545
Location: Austin, TX, USA

PostPosted: Tue 07 Apr 2009, 14:09    Post subject:  

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

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?
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 07 Apr 2009, 14:22    Post subject:  

maybe like this:

Code:
epdfview /root/pdf1.pdf &
pid=$!
sleep 20
kill $pid


Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0437s ][ Queries: 11 (0.0070s) ][ GZIP on ]