------------------------------------------------------------------------------- Remote Control The idea here is to some how control an already running program, typically an image display of some kind, so that it then displays a new image. This allows a interactive graphical interface from a shell script. ------------------------------------------------------------------------------- Imagemagick "display" and "animate" programs Example... display ~/im/img_photos/parrots_orig.png & sleep 10 display -remote ~/im/img_photos/hats_orig.png & sleep 10 xdotool search -class "display" windowkill I have used this with "animate" to generate a 'on the fly' morphing slideshow http://www.imagemagick.org/Usage/scripts/slideshow_morph and http://www.imagemagick.org/Usage/scripts/slideshow_next Animate can however take a but of time to read and prepare an animation for display, and in some cases can have a 'slow' initial loop through the image, before it re-loops, at fill speed. Note that by using ephemeral: on the input file name (delete after read) you can learn from "display" when it has finished reading its input image, though it may not have displayed it yet. I have found no way (at this time) to tell when an "animate" has reached the last image in its 'loop', so a new animation can be given to it before it loops or exits. To prevent user menu popups include -immutable (image is read only) flag. Posible improvements... * Have "display" return user 'click' positions, and 'keys' as feedback. * Have "animate" Provide verbose feedback on what image it is up to. And especially when it has reached the end of a 'no-loop' animation. * Allow "animate" to wait further instructions at that point (no exit) * Have animate not change its display (or initially open) until it has fully read the next animation. ------------------------------------------------------------------------------- feh If the feh process is sent a USR1 signal it will display the next image. If it is then sent a USR2 signal it will go back to the previous image. For example feh anime/I* & pid=$! sleep 2; kill -s USR1 $pid # display second image sleep 2; kill -s USR1 $pid # display third image sleep 2; kill -s USR1 $pid # ... sleep 2; kill -s USR1 $pid On the fly image chamnging... Attempt 1: changing filelist... (FAIL) Presumably I can feed it new images via the -f filelist then signal it. to loop over these new images. This however fails as feh 'rewrites' the filelist before looping! That is it wipes out my new list with the old list. Arrgghhh.. Attempt 2: change image in given filename (FAIL) Alternativeally give it a loop with a changing single image (or symbolic link to desired image to save copying). That way I simply change image, and signal "feh" to loop and read/display the new image. ln -fs anime/Inuyasha_001.png i feh i & pid=$! sleep 2 ln -fs anime/Inuyasha_002.png i kill -s USR1 $pid This fails as "feh" knows it only has one image when it loops, so it doesn't do anything! Even though the image changed! In other words "feh" is being too smart for its own good. Attempt 3: Use two filenames for images (SUCCESS) Using two image links however works fine! Note the two links must be two different filenames. Though to make it work well you should make both files contain the same image you want to display, so you don't need to remeber which file "feh" will be reading next. A simple way is to make the second filename a symbolic link to the first filename, while you make the first filename a symbolic link pointing to the image you want to display next. That way whatever file "feh" next reads when you signal it, will get the image you just set it to read. The second filename link remains unchanged, and is just to make it work. # prep, and show first image ln -sf anime/Inuyasha_001.png i1 ln -s i1 i2 # link second image to first link. feh i1 i2 & pid=$! # show second image sleep 2 ln -fs anime/Inuyasha_002.png i1 kill -s USR1 $pid # show third image sleep 2 ln -fs anime/Inuyasha_003.png i1 kill -s USR1 $pid Posible improvements... * Feedback on when "feh" finished reading the image so you can flip to next images as fast as posible. * Return information on a montage/index/thumbnail selections (for a select image application) * Feedback on user mouse clicks (or keystrokes) in main image window (does not have to be complex, just simple event feedback) These last two could be implemented as a "feh" 'action' option. See also the forum thread... http://crunchbanglinux.org/forums/post/216938/ ------------------------------------------------------------------------------- xv XV does not provide any remote control features, but does provide a lot of options to confire how an image is to be displayed, and exactly where windows should appear. In this aspect this old project is still far better than most modern image display programs. So if you don't mind killing and restarting the image window, XV is still a good choice. -------------------------------------------------------------------------------