Bash slide-show script using spacebar or enter as stepper

Asked by Julianloui

2014-09-27

I am trying to modify my slide-show bash script so that the last image will remain on the screen until I click the spacebar or enter key to tell the script to step to the next command line. Essentially I am trying to implement a single-stepping slide-show script.

Any help will be much appreciated.

Julianloui

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Thomas Krüger (thkrueger) said :
#1

Sorry, but without any information on your script we are unable to assist.

Revision history for this message
Julianloui (julianloui) said :
#3

Thomas,

Pleasee ignore Post #2. I simply lost control of Launchpad's editor. Once again I wish Launchpad.net would be more sympathetic to its less efficient users. It's a pain for me to use a Linux support website that does not permit users to edit their typing. Of course, they can always espond "Why don't you go elsewhere.".

Julianloui
----------------------------------------------------------------------------------------------------------------------------------
# insert code here to pause and to step to next command line via keyboard spacebar
  shotwell dog.jpg &
  sleep 5
  espeak -v f2 "Dog,,, Dog" &
  sleep 6

# etc.

#! /bin/bash
#
  shotwell apple.jpg &
  sleep 6
  espeak -v f2 "Apple,,, Appple" &
  sleep 6

# insert code here to pause and to step to next command line via keyboard spacebar
  shotwell banana.jpg &
  sleep 5
  espeak -v f2 "Banana,,, Banana" &
  sleep 6

# insert code here to pause and to step to next command line via keyboard spacebar
  shotwell cat.jpg &
  sleep 5
  espeak -v f2 "Cat,,, Cat" &
  sleep 6

# insert code here to pause and to step to next command line via keyboard spacebar
  shotwell dog.jpg &
  sleep 5
  espeak -v f2 "Dog,,, Dog" &
  sleep 6

# etc.

Revision history for this message
Thomas Krüger (thkrueger) said :
#4

"read" will wait for Enter. "read -n 1" will wait for any printable key. But the Terminal needs to have the focus not the image viewer. So you might have to use a completely different approach.

Revision history for this message
Julianloui (julianloui) said :
#5

Thanks very much again. I agree that I'll need to seek a different approach.

Actually recently I implemented a not so smooth but working stop-and-start version of my original free-running script
by inserting the following three lines between frames.

pkill -9 shotwell
clear
read -p "Press [ENTER] key to continue..."

Julianloui

Can you help with this problem?

Provide an answer of your own, or ask Julianloui for more information if necessary.

To post a message you must log in.