Last active
October 28, 2018 03:17
-
-
Save photonxp/8378d5c145b07f79a1e4830e8e7f121e to your computer and use it in GitHub Desktop.
Use EOG to show the latest image file under a given directory dynamically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# images are continueously updated in a given directory [img_src_dir] | |
# use the `ls -t` command to find the latest image file | |
# use eog to show the latest image file dynamically | |
# In the eog Preferences/Slideshow, uncheck the "Loop sequence" option | |
# So EOG and Entangle can be used together | |
img_src_dir="/home/to/Capture" | |
img_dst_dir="/home/to/eog/img_dir" | |
test_img_path="$img_dst_dir/test.jpg" | |
# to ls files under a dir and sort by time | |
img_name=`ls -t $img_src_dir | head -1` | |
echo $img_name | |
img_src="$img_src_dir/$img_name" | |
cp $img_src $test_img_path | |
eog $test_img_path & | |
ls -l $img_dst_dir | |
while true | |
do img_name=`ls -t $img_src_dir | head -1` | |
img_src="$img_src_dir/$img_name" | |
cp $img_src $test_img_path | |
echo $img_src | |
echo $test_img_path | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment