$ARGUMENT to the hook script, which you can use.
As an example:-
if [ $ARGUMENT ]; then
if [[ $ARGUMENT =~ .+\.[jpg|JPG] ]]
# Then next few lines are optional
# Alternatively pass $ARGUMENT directly to your image viewer eg:-
# /usr/bin/shotwell "$ARGUMENT" &
mv "$ARGUMENT" "$NEWFILENAME"
/usr/bin/shotwell "$NEWFILENAME" &
This opens the file in
shotwell, but that's easy to change to your preferred viewer.
if statement makes sure that shotwell is only used if the downloaded file is a JPG as I sometimes had the camera set to create raw (CR2 on a Canon) which wouldn't open in shotwell. I suppose it could be expanded to to open those with another viewer.
The image will be saved as the argument supplied to
--filename - in your case
/home/media/usbpendrive/image-20140616-125500.jpg. That will be the value stored in
$ARGUMENT and passed to your hook script.
You could use
basename to split this path and filename to their relevant parts and then re-use them to create a new path and filename for the image.
$ARGUMENT is only available when
gphoto is downloading the image, so a check of
$ACTION would be redundant in this case.
The file will need to have it's executable bit set, of course.
I only stopped using this when I found Entangle but I'm not sure that's available on the Pi.