From: Agnibho Mondal Date: Fri, 16 Feb 2018 03:17:04 +0000 (+0530) Subject: Get editor from environment variables X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=86d9af7d9f02a9ed646ae5a8fec00c909cf63c55;p=imagecap.git Get editor from environment variables --- diff --git a/imagecap b/imagecap index 9adb1f5..6ec76be 100755 --- a/imagecap +++ b/imagecap @@ -22,11 +22,16 @@ # www.agnibho.com SELF="$(realpath "$0")"; -EDIT="gvim -f"; +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 - #IMG="$(feh -U "$DIR"|grep "$ARG$")"; IMG="$DIR/$(basename "$ARG")"; fi