Refactor xinit to be more structured and set $EDITOR if unset to vis

This commit is contained in:
Miles Alan 2020-07-17 22:02:24 -05:00
parent d2ee25d724
commit 5c4c6c15e2
3 changed files with 60 additions and 36 deletions

View file

@ -1,5 +1,4 @@
#!/usr/bin/env sh
EDITOR=vis
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem
err() {
@ -16,7 +15,7 @@ modem_n() {
editmsg() {
TMP="$(mktemp --suffix "$1_msg")"
echo "$2" > "$TMP"
TEXT="$(st -e $EDITOR "$TMP")"
TEXT="$(st -e "$EDITOR" "$TMP")"
cat "$TMP"
}