[PLUG] Using display for sequence of images

King Beowulf kingbeowulf at gmail.com
Mon Oct 24 17:54:08 UTC 2016


On 10/24/2016 08:30 AM, Rich Shepard wrote:
>    The 'display' man page tells me that it 'displays an image or image
> sequence on any X server' and suggests looking at the web page or equivalent
> in /usr/share/doc/ImageMagick-6/www/display.html. Since no command line
> option seems to direct display to read the image file names from a file I
> assume that I need to list the filenames in a script with a command that
> waits for my input before changing images. Is this correct?
> 
>    Seems like the bash 'read -p' command would be appropriate, but I have not
> used it before and don't know how to use it for a sequence of 'display'
> commands.
> 
>    I want to display a series of images (*.jpg and *.png) and have them
> change under user control. If you've done this before and are willing to
> share your script, please do so.
> 
> TIA,
> 
> Rich
> 

Maybe something along these lines:

BASH one-liner to manually scroll though a set ('space' to advance):
$ slide_pix=("tux.jpg" "unix_wizard.jpg"); display ${slide_pix[@]}

Script with menu:

#!/bin/bash

# Ctrl-C exits while loop
# need to add valid input check !!

slide_pix=("tux.jpg" "unix_wizard.jpg")
pix=""
echo "Picture Menu:"
echo "x = exit"
echo "0 = pix 1"
echo "1 = pix 2"

while true; do
  read -p "Choose: " pix
  if [ "$pix" = "x" ]; then
    exit 0
  fi
  display ${slide_pix[$pix]}
done
exit 0




More information about the PLUG mailing list