From 256bc9f4d5fb21fc3f42210562c7012f14f96bb2 Mon Sep 17 00:00:00 2001 From: josuah Date: Tue, 31 Jan 2017 15:40:56 +0100 Subject: [PATCH] Added io-mblaze and removed io-ii.1 --- io-abduco | 21 ++++++++------- io-ii.1 | 90 --------------------------------------------------------------- io-mblaze | 16 ++++++++++++ 3 files changed, 27 insertions(+), 100 deletions(-) delete mode 100644 io-ii.1 create mode 100755 io-mblaze diff --git a/io-abduco b/io-abduco index e330cb3..f1214a4 100755 --- a/io-abduco +++ b/io-abduco @@ -1,14 +1,15 @@ # Prompt for an abduco session to attach to -[ "$ABDUCO" = 'main' ] || [ -z "$ABDUCO" ] || exit 1 - -name="$( - printf '#%s' "$( - abduco | sed -r 's/(.*)\t(.*)/\2 # \1/' - )" | iomenu -s '#' -)" - -if [ "$name" != "$ABDUCO" ] && [ "$name" ] +if [ "$ABDUCO" ] then - TERM=screen ABDUCO="$name" exec abduco -e '^Z' -A "$name" "$SHELL" + printf 'session already active: %s\n' "$ABDUCO" + exit 1 fi + +name="$(printf '#%s' "$( + abduco | sed -r 's/(.*)\t(.*)/\2 # \1/' +)" | iomenu -s '#')" + +[ "$SSH_CLIENT$SSH_TTY$SSH_CONNECTION" ] && e='^\' || e='^Z' + +TERM=screen ABDUCO="$name" exec abduco -e "$e" -A "$name" "$SHELL" diff --git a/io-ii.1 b/io-ii.1 deleted file mode 100644 index 3f2a533..0000000 --- a/io-ii.1 +++ /dev/null @@ -1,90 +0,0 @@ -.Dd $Mdocdate: October 30 2016$ -.Dt IO-II 1 -.Os -.Sh NAME -. -.Nm io-ii -.Nd ii wrapper script using iomenu -. -.Sh SYNOPSIS -. -.Nm io-ii -. -.Sh DESCRIPTION -. -.Nm -is an interactive interface for the ii irc client. It handles multiple -channel, keybindings, and prevent input from being mixed with the output. -.Pp -Simply launch it, follow what is prompted, and it should work. -.Pp -This is an interactive interface for the -.Xr ii 1 -irc client using -.Xr iomenu 1 -to switch channel and connect to server. -.Pp -It then require the -.Xr ii 1 -binary - the back-end - that you can replace with any FIFO-based chat client, -that has the following file structure: -. -.Bd -literal -~/.cache/irc default root directory -│ -├ irc.freenode.net managed by "ii -s irc.freenode.net" -│ │ -│ ├ #emacs channel directory -│ │ ├ in -│ │ └ out where you get log from #emacs -│ │ -│ └ #vim -│ ├ in where to write messages to #vim -│ └ out -│ -└ irc.oftc.net managed by "ii -s irc.oftc.net" - │ - └ #suckless - ├ in FIFO file descriptor aka a named pipe - └ out regular file -.Ed -.Pp -One ii command has to be started per server, and every instance will keep -running in the background, so you can quit the interface and keep ii running, -and come back later, without interrupting the connection. -.Pp -The supported irc commands are those supported by -.Xr ii 1 -so you can refer to its manual. -. -.Sh KEY BINDINGS -. -.Bl -tag -.It Ctrl + N/P -Prompt for another channel to switch to. -.It Ctrl + C -Quit the interface, but not the ii instances. -.It Ctrl + M -.It Enter -Send a message to current channel -. -.It Ctrl + L -Open the current channel in a pager. -. -.It Ctrl + U -Clear current input. -. -.It Ctrl + W -Clear last word from current input. -.El -. -.Sh SEE ALSO -. -.Xr ii 1 -.Xr iomenu 1 -. -.Sh AUTHORS -. -.Nm io-ii -is made by -.An Josuah Demangeon Aq mail@josuah.net diff --git a/io-mblaze b/io-mblaze new file mode 100755 index 0000000..b613a35 --- /dev/null +++ b/io-mblaze @@ -0,0 +1,16 @@ +T=' ' +choice="$( + mdirs "${MAIL%/*}" | while IFS='' read -r dir + do + printf '#\n# %s\n' "${dir##*/}" + + mlist "$dir" | mpick :u | msort -d | mthread | + mscan -f '%D %24f %u%t%2i%120S' + + done | iomenu -N -H -s '#' -l 255 +)" + +[ "$choice" ] || exit 0 + +mlist "${MAIL%/*}/${choice%%$T*}" | mpick :u | msort -d | mthread | +sed -n "${choice#*$T}p" | mshow | $PAGER -- 2.11.4.GIT