Your existing construction will attempt to run
cat images.txt | sxiv -i -t every tenth of a second. If
sxiv takes longer than that to do whatever it does, things could get quite messy. You might be better off looking at a hash of a checksum of all of the images:
$ md5sum *.jpg | md5sum
This takes a hash of all of the
.jpg files, and makes a hash of that. This means that the sur-checksum will change if any of the images are changes, as well as if any are added or removed.
So we can do something like this:
old_checksum="$(md5sum *.jpg | md5sum)"
while /bin/true; do
new_checksum="$(md5sum *.jpg | md5sum)"
if [[ "$new_checksum" != "$old_checksum" ]]; then
find . -maxdepth 1 -name \*.jpg -print0 | xargs -0 sxiv -i -t
Anytime anything changes, take a note of the new checksum, and re-run
If you still want to keep your catalog of
.jpg files in
images.txt, this can be easily modified to use the contents of that file for creating the checksum and for providing arguments to
xargs in lieu of