From 86d9af7d9f02a9ed646ae5a8fec00c909cf63c55 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Fri, 16 Feb 2018 08:47:04 +0530 Subject: [PATCH] Get editor from environment variables --- imagecap | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.5