]> Softwares of Agnibho - imagecap.git/blobdiff - imagecap
Use zenity to edit text
[imagecap.git] / imagecap
index 6f2b86b3b947ca1ce60baaafd7e51c04bdef0146..eec547e6f81eae4e185b68308471cde6b21642fb 100755 (executable)
--- a/imagecap
+++ b/imagecap
 # www.agnibho.com
 
 SELF="$(realpath "$0")";
-if [ "$VISUAL" ];then
-       EDIT="$VISUAL";
-elif [ "$EDITOR" ];then
-       EDIT="$EDITOR";
-else
-       EDIT="vi";
-fi
 ARG="$(echo $1 | sed "s/^file:\/\///g")";
 DIR="$(dirname "$ARG")";
 if [ -n "$ARG" ];then
@@ -36,12 +29,11 @@ if [ -n "$ARG" ];then
 fi
 
 function update(){
-       TEMP=$(mktemp);
-       exiftool -S -s -b -comment "$1">$TEMP;
-       ls -l $TEMP;
-       $EDIT $TEMP;
-       exiftool -overwrite_original_in_place "-comment<=$TEMP" "$1";
-       rm $TEMP;
+       DATA=$(exiftool -S -s -b -comment "$1");
+       DATA=$(echo -n "$DATA"|zenity --text-info --editable --title="Edit Caption" --ok-label="Update");
+       if [ "$?" = "0" ];then
+               exiftool -overwrite_original_in_place -comment="$DATA" "$1";
+       fi
 }
 
 function view(){