diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2010-08-21 11:37:46 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2010-10-02 11:56:29 -0400 |
commit | 36b6240a73ceb9d7b5c504e960d491693de98199 (patch) | |
tree | 3e4b5c5af427d548b9f414b30f5555aaea7bd24e /examples/data/scripts/formfiller.sh | |
parent | 8eed5f24a0d40574433c3f3a945e6aac75e06aba (diff) |
Migrate to using the editor util script
Diffstat (limited to 'examples/data/scripts/formfiller.sh')
-rwxr-xr-x | examples/data/scripts/formfiller.sh | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index cf8e46b..fb1eb02 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -43,6 +43,7 @@ DMENU_LINES="3" DMENU_PROMPT="Choose profile" source $UZBL_UTIL_DIR/dmenu.sh +source $UZBL_UTIL_DIR/editor.sh source $UZBL_UTIL_DIR/uzbl-args.sh source $UZBL_UTIL_DIR/uzbl-dir.sh @@ -51,15 +52,6 @@ MODELINE="> vim:ft=formfiller" [ -d "$(dirname $UZBL_FORMS_DIR)" ] || exit 1 [ -d $UZBL_FORMS_DIR ] || mkdir $UZBL_FORMS_DIR || exit 1 -editor="${VISUAL}" -if [ -z "${editor}" ]; then - if [ -z "${EDITOR}" ]; then - editor='xterm -e vim' - else - editor="xterm -e ${EDITOR}" - fi -fi - action=$1 domain=$(echo $UZBL_URL | sed 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/') @@ -158,7 +150,7 @@ elif [ "$action" = "once" ]; then socat - unix-connect:$UZBL_SOCKET | \ sed -n '/^[^(]\+([^)]\+):/p' > $tmpfile echo "$MODELINE" >> $tmpfile - ${editor} $tmpfile + $UZBL_EDITOR $tmpfile [ -e $tmpfile ] || exit 2 @@ -203,7 +195,7 @@ else sed -n '/^[^(]\+([^)]\+):/p' >> $UZBL_FORMS_DIR/$domain fi [ -e "$UZBL_FORMS_DIR/$domain" ] || exit 3 #this should never happen, but you never know. - $editor "$UZBL_FORMS_DIR/$domain" #TODO: if user aborts save in editor, the file is already overwritten + $UZBL_EDITOR "$UZBL_FORMS_DIR/$domain" #TODO: if user aborts save in editor, the file is already overwritten fi # vim:fileencoding=utf-8:sw=4 |