#!/bin/bash
##################################################################################
#                                                                                #
#  Action script for Nemo filenmanager and shows image metadata.                 #
#  Depends on: exif, yad                                                         #
#                                                                                #
#  Made by Koentje.        lowrida007@gmail.com                                  #
#                                                                  version 1.1   #
##################################################################################

tmpfile="/tmp/exiflog.tmp"
#cmdfile="/tmp/exifcmd.tmp"

if [ "$1" = "" ]; then
  text=" This is an action script for nemo and can't be started from the terminal.  \n"
  b="Error"
else
set +
   b=$(basename "$@")
   exif "$@" 2&> "$tmpfile"
   text=$(cat $tmpfile)
fi

yad --text="\n<span font='Ubuntu Mono 12'> $text </span>" --title="$b" --image="gnome-graphics" --center --fixed --on-top --width=550 --height=70 --button="OK" &
