------------------------------------------------------------------------------- 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 full speed. Arrrggghhhh.... I have found no way (at this time) to tell when an "animate" has reached the last image in its 'loop', or even know what frame it is currently displaying. That could be useful to give it a new images after previous images have completed. 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. That is useful for programs to know when it can 'continue' after launching a image display. To prevent user menu popups in "display" 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 frame it is displaying 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. ------------------------------------------------------------------------------- geeqie Geeqie provides some controls designed with simple slideshows in mind rather than more complex scripted interfaces. geeqie -rh remote control help geeqie -r -t {image}... starts a window, no tools, set initial file geeqie -r {image}... new file list to display geeqie -r -n next image in collection geeqie -r -b previous image in collection geeqie -r -q exit Main problems... Use geegie -l to open a image collection window, of the list of images. The slide show follows that 'collection' list even if it is not visible. Images displayed from this collection may be different to the directory listing shown, which can make the on screen display confusing. The display can be set to/from fullscreen mode, non-fullscreen mode cannot be set to image size or even to a pre-defined geometry (size and placement). The window is also automatically brought to the top of the display stack when a remote command is given. This is not good, especially as other tools can do this if it is wanted. This slideshow remote control is a lot simpler than "feh", Though "feh" also provides some initial window geometry control, and minor feedback capability. ------------------------------------------------------------------------------- eog - eye of gnome This by default re-uses the currently open (like "geegie -r") only basic info and a posible gallery of images is displayed But galley can be from multiple different directories. VERY minimal control (as is typical of gnome applications ------------------------------------------------------------------------------- feh Normal mode is 'slideshow' which displays images one at a time other modes -l just list image info (no display) -m montage of thumbnails (no actions) -i index mode (as montage but with filenames and sizes) -t thumbnail (clicking shows that image, or launches an action) -w multi-window - one window per image There are ways of reporting a specific image selection from thumbnail mode. But that is about all :-( (See below) Derf (author) reports that receiving commands from the terminal that started feh is supported as of feh 2.20. I have not yet explored this! Remote control of image being displayed... Methodology... Using normal slideshow, signal USR1 will display the next image, signal USR2 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 The key however is that if feh reaches the end of a image list it cycles back to the start. -- UPDATE unless you use --no-cycle --- Attempt 1: changing a filelist of images to display (FAIL) Feed "feh" a '-f' filelist of images, then signal it to re-read the filelist, to loop only 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.. Also it will always try to read the whole filelist at the start rather than proceeding with just the first image, and only reading the next image when signaled. --- Attempt 2: change image in filename being displayed (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) Changing the contents of a list of two images 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. that way you don't need to remember 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 "feh" 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 image! feh i1 i2 & # give feh TWO images! pid=$! # show next image sleep 2 ln -fs anime/Inuyasha_002.png i1 kill -s USR1 $pid # show next image sleep 2 ln -fs anime/Inuyasha_003.png i1 kill -s USR1 $pid --- Attempt 4: Use a named pipe for images (FAIL) If we can make feh read an image from a named pipe, we could have it automatically 'proceed to next image' (using a small time delay) and just feed it a new image each time it reads. # prep, and show first image mkfifo i1 ln -s i1 i2 feh -D 0.001 i1 i2 & cat anime/Inuyasha_001.png > i1 sleep 2 cat anime/Inuyasha_002.png > i1 sleep 2 cat anime/Inuyasha_003.png > i1 Fail .. feh will NOT read from a named pipe! ----- Image selection You can use "feh" to select images for some action. Example... feh --quiet --thumbnail {dir} -title "Pick Image" \ --action "program -option %n" NOTE: The action program could be the same script that launches the "feh" with -option indicating it is a selected image. This is how "feh_smiley_picker.sh" worked. feh can check if image is usable using -U or --loadable I can't find a way to turn off the filenames under the images! Though themes indicate "--index-name 0" should do it, "feh" complains it as a "unrecognized option". ----- Posible improvements for "feh".. * Feedback on when "feh" finished reading/displaying an image, or even just the last image in a slide show, so you know when you can proceed. Could be run a program, which can signal a control app, or launch a new "feh". * Run a action (to return info) on a montage/index/thumbnail selections (for a select a image type application) * Feedback on location of user mouse clicks (or keystrokes) in main image window. * allow it to read image (or image sequences) from a named pipe See also https://github.com/derf/feh/issues/67 ------------------------------------------------------------------------------- xv XV does not provide any remote control features, but does provide a lot of options to configure how an image is to be displayed, and exactly where windows should appear. This allows this old program is often far better than most modern image display programs, which provide no such fine tuning. Its built-in image processing features are also often lacking in other image viewers. So if you don't mind killing and restarting the image window as needed, XV is still a good choice. -------------------------------------------------------------------------------