From 3f3a24ef9f5f7d6ddbbdb97fecebf2e269c47015 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Thu, 1 Mar 2018 06:48:49 +0530 Subject: [PATCH] Use zenity to edit text --- README | 2 +- imagecap | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) 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(){ -- 2.39.2