From: Agnibho Mondal Date: Thu, 1 Mar 2018 01:18:49 +0000 (+0530) Subject: Use zenity to edit text X-Git-Url: https://code.agnibho.com/repo?p=imagecap.git;a=commitdiff_plain;h=HEAD Use zenity to edit text --- diff --git a/README b/README index 47a40ec..fba1aa0 100644 --- a/README +++ b/README @@ -17,7 +17,7 @@ Latest release of ImageCap can be downloaded from http://code.agnibho.com/imagec Dependencies ------------ -ImageCap depends on: bash, coreutils, sed, exiftool, feh, xdg-open. +ImageCap depends on: bash, coreutils, sed, exiftool, feh, zenity. Installation ------------ diff --git a/imagecap b/imagecap index a5a8f12..eec547e 100755 --- a/imagecap +++ b/imagecap @@ -29,12 +29,11 @@ if [ -n "$ARG" ];then fi function update(){ - TEMP=$(mktemp); - exiftool -S -s -b -comment "$1">$TEMP; - ls -l $TEMP; - xdg-open $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(){