dot

packages and services management
Log | Files | Refs | README

commit a308702b7b07a2f9f7544938f3bbb234cc8b2614
parent 83565bc916a969efb85f3f376cea2289023e52ea
Author: josuah <mail@josuah.net>
Date:   Fri,  2 Sep 2016 00:23:30 +0200

piped: Added a small utility to edit pipes

Diffstat:
Mbin/irc | 3+--
Abin/piped | 16++++++++++++++++
Mdvtm/config.h | 1+
Mshell/.profile | 2+-
4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/bin/irc b/bin/irc @@ -40,8 +40,7 @@ connect() mkdir -p "$srv" [ -p "$srv/IN" ] || mkfifo "$srv/IN" - # `tee ... RAW` is for debugging, you can remove it. - tail -f "$srv/IN" | tee -a "$srv/RAWIN" | nc "$srv" 6667 | tee -a "$srv/RAW" | output "$srv" & + tail -f "$srv/IN" | nc "$srv" 6667 | output "$srv" & write "$srv" "NICK $user" write "$srv" "USER $(whoami) +i * :$FULLNAME" diff --git a/bin/piped b/bin/piped @@ -0,0 +1,16 @@ +# __ /\ +# ____ \/ ____ ___ ___/ / +# / __ \ /\ / __ \ .'__ \ .'__ / +# / /_/ / / // /_/ // ____// /_/ / +# / ____/ \// ____/ \___\ \____/ - Pipe from stdin to stdout with $EDITOR +#=\/=========\/================================================================= + +tmp="$(mktemp)" + +cat > "$tmp" + +($EDITOR "$tmp") 1>&2 + +cat "$tmp" + +stty sane diff --git a/dvtm/config.h b/dvtm/config.h @@ -244,6 +244,7 @@ static char const * const keytable[] = { * are generated in the output. */ static Editor editors[] = { + { .name = "piped", .argv = { "vis", "+%d", "-", NULL }, .filter = true, .color = false }, { .name = "vis", .argv = { "vis", "+%d", "-", NULL }, .filter = true, .color = false }, { .name = "sandy", .argv = { "sandy", "-d", "-", NULL }, .filter = true, .color = false }, { .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL }, .filter = true, .color = false }, diff --git a/shell/.profile b/shell/.profile @@ -32,7 +32,7 @@ do command -v "$editor" > /dev/null && EDITOR="$editor" done export EDITOR export ALTERNATE_EDITOR='vi' -export DVTM_EDITOR="$EDITOR" +export DVTM_EDITOR='piped' export VISUAL="$EDITOR" export FCEDIT="$EDITOR" export PAGER='less -FIRM'