geeqie
geeqie copied to clipboard
Accept dynamic changes to slideshow list
ISSUE TYPE
- Feature Request
GEEQIE VERSION
All versions
SUMMARY
If the slideshow is set to Repeat and is displaying images from a folder or collection, adding an image to the folder causes the slideshow to stop. It should be possible to add or remove images from a folder, and for the slideshow to continue.
Dunno if this will be useful to anybody, but I wrote the following script, gqview-picset, for use with gqview. It might be adaptable to geeqie. As it says, it's tailored to my usage patterns. I apologize for pasting it here; github is being finicky.
#!/bin/bash
#
# Helper script to display a set of photos in gqview, choosing the
# last but then starting a slideshow after a delay.
#
# This is very carefully tailored to my usage patterns.
#
# Each invocation adds to a list of pictures to display.
#
USAGE="Usage: gqview-picset -c -D # -d # -k -z pic-files
-c Clear the current list of files before adding new ones.
-D # Give the slide show inter-slide delay time (default 5
seconds, precision 0.1 seconds). Note that if gqview
is exited normally, this value will become the new
default for future invocations not made through this
script.
-d # Give the delay until starting the slide show (default
60 seconds).
-k Kill xscreensaver.
-z Remove the given picture(s) from the display list."
FILES=/tmp/gqps.files
delay=60
slideshowDelay=5
zapDisplay=false
while (( $# > 0 ))
do
case "$1" in
-c)
rm -f $FILES
;;
-D)
slideshowDelay="$2"
shift
;;
-d)
delay="$2"
shift
;;
-k)
pkill xscreensaver
pkill glslideshow
;;
-z)
zapDisplay=true
;;
--)
shift
break
;;
-*)
echo "$USAGE" 1>&2
exit 2
;;
*)
break
;;
esac
shift
done
#
# If the list of files is more than a day old, blow it away.
#
fileAge=$(find $FILES -mtime +0 2>/dev/null)
[ -n "$fileAge" ] && rm $FILES
for file
do
if $zapDisplay
then
grep -v "$file" $FILES | sort -u -o $FILES
else
echo "$file" >> $FILES
fi
done
sort -u -o $FILES $FILES
[ -s $FILES ] || exit 0
#
# Remember when we created the updated file list. We depend here on the
# precision of modern Unix timestamps.
#
listTime=$(date +%s.%N)
#
# Put the new file list into gqview, and go to the last one.
#
# Note: we redirect all gqview output because it's a chatty program.
# The redirection needs to be removed in three places if debugging is
# necessary.
#
gqview --remote -fs $(cat $FILES) &>/dev/null
#
# If there is more than one file, choose the last and spawn a
# background job to start a slide show.
#
if (( $(wc -l < $FILES) > 1 ))
then
gqview --remote --slideshow-stop --last &>/dev/null
#
# Spawn a background job that will start a slide show if we've
# been idle for $delay seconds. But only do that if there are
# multiple pictures.
#
(
sleep $delay
found=$(find $FILES -newermt @$listTime)
#
# gqview is a bit quirky about setting the slide show delay. You
# have to stop and restart the show before the delay will take
# effect. (Also, there's a bug of some sort that requires you
# cuddle the value with the -d option, but I'm going to use the
# long --delay version so I don't care.)
#
if [ -z "$found" ]
then
gqview --remote --slideshow-stop --delay=$slideshowDelay \
--slideshow-start \
&>/dev/null
fi
) &
fi