dot

packages and services management
Log | Files | Refs | README

commit 52d23ac74bd36d3bf5df3b30efeb5346c85ef100
parent cdd0c50e5128fdb0eee9b3d61e0d54eaae7d4955
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 20 May 2017 18:39:27 +0200

fixing again on Linux

Diffstat:
Mbin/io | 2+-
Mbin/io-abduco | 27++++++++++++++++++++-------
Mbin/io-files | 2+-
Mbin/io-irc | 10+++++++++-
Mbin/io-search | 2+-
5 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/bin/io b/bin/io @@ -92,4 +92,4 @@ printf '\033[H\033[2J' [ "$SSH_TTY" ] && e='^\' || e='^Z' command -v "$command" && [ "$path" ] && -exec io-abduco $command "$path" +exec $command "$path" diff --git a/bin/io-abduco b/bin/io-abduco @@ -3,12 +3,25 @@ touch "$HOME/.abduco/names" -case $# in -( 0 ) attach=0 ;; -( 1 ) attach=1 command=$EDITOR path=$1 ;; -( 2 ) attach=1 command=$1 path=$2 ;; -( * ) exit 1 ;; -esac + +# --- update ------------------------------------------------------------------- + + +if [ $# = 0 ] +then + attach=0 +else + [ $# = 1 ] && command=$EDITOR || command= + attach=1 +fi + +while [ $# -gt 1 ] +do + command="$command $1" + shift +done + +path=$1 # --- update names ------------------------------------------------------------- @@ -30,7 +43,7 @@ if [ "$attach" = 1 ] then [ "$ABDUCO" ] && exit 1 [ "$SSH_TTY" ] && e='^\' || e='^Z' - ABDUCO=$1 exec abduco -e "$e" -A "$hash" "$command" "$path" + ABDUCO=$1 exec abduco -e "$e" -A "$hash" $command "$path" else sed 's/[^ ]* //' "$HOME/.abduco/names" fi diff --git a/bin/io-files b/bin/io-files @@ -1,3 +1,3 @@ # Attach to an abduco session -[ -f "$1" ] && $EDITOR -R "$1" +[ -f "$1" ] && io-abduco $EDITOR -R "$1" diff --git a/bin/io-irc b/bin/io-irc @@ -1,3 +1,11 @@ # a pager to browse ii channels -[ -d "$1" ] && cd "$1" && less out +[ -d "$1" ] || exit 1 + +tail -f -n 40 "$1/out" & + +while IFS='' read -r line +do + printf '\r\033[K' 1>&2 + printf '%s\n' "$line" > "$1/in" +done diff --git a/bin/io-search b/bin/io-search @@ -14,4 +14,4 @@ EOF path="${path#\# }" -exec $EDITOR +"$number" "$path" +exec io-abduco $EDITOR +"$number" "$path"