dot

packages and services management
Log | Files | Refs | README

commit dcb431a087a8a678927cac08745eb1591f6db9ce
parent bca1277d04450228507d85baccb402536dc64b42
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 28 Apr 2017 01:45:31 +0200

Layer 01

Diffstat:
Mbin/io | 52+++++++++++++++++++++++++++++++++++++---------------
Mbin/io-abduco | 11++++-------
Rbin/io.1 -> man/io.1 | 0
3 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/bin/io b/bin/io @@ -1,30 +1,52 @@ # content of Wired -while IFS='' read -r line + +CACHE="$HOME/.cache/io" + + + + +line="$(while IFS='' read -r line do - if [ -z "${line%%#*}" ] + if [ "$line" ] && [ -z "${line%%# *}" ] then - command="${line#?}" - command="${line# }" + line="${line### }" command="${line%%#*}" + [ -z "${line##*#*}" ] && options="${line#*#}" || option='' - options="${line#?}" - options="${line#*#}" - [ -z "${line###*#*}" ] || option='' + printf '# %s\n' "$command" - printf '# %s\n' "$command' - elif [ -d "$line" ] + elif [ "$line" ] && [ -d "$line" ] then - find "$line" $options | tee -a "$CACHE/$(printf %s "$line" | sed 's|/|!|g')" + mkdir -p "$CACHE/${command%% *}" + name="$(printf %s "$line" | sed 's|/|!|g')" + + find "$line" $options | tee -a "$CACHE/${command%% *}/$name" - else [ -f "$line" ] + elif [ -f "$line" ] then cat "$line" - elif [ -z "$line" ] + + elif [ "$line" ] + then printf '%s\n' "$line" - ( '#'* ) ;; - () ;; -done << EOF + fi +done << EOF | iomenu -s -h -p io | sed 's/# //' + +# io-abduco +$(abduco | tail -n +2) +# mandoc -a # -type f -name *.[1-9] +$(printf %s "$MANPATH" | sed 's/:/\n/g') + +# exec # -type f +$HOME/etc EOF +)" + +command="${line%% *}" +path="${line#* }" +printf '%s\n' "$command" "$path" + +exec $command "$path" diff --git a/bin/io-abduco b/bin/io-abduco @@ -1,4 +1,6 @@ -# Prompt for an abduco session to attach +# Attach to an abduco session + +name="${1##* }" if [ "$ABDUCO" ] then @@ -6,11 +8,6 @@ then exit 1 fi -name="$( - abduco | tail -n +2 | iomenu -l 10 -p 'abduco' | - sed -r 's/[^\t]*\t[^\t]*\t//' -)" - printf '\033[H\033[J' # clear the screen -[ "$name" ] && ABDUCO="$name" exec abduco -A "$name" "$SHELL" +[ "$name" ] && ABDUCO="$name" exec abduco -a "$name" diff --git a/bin/io.1 b/man/io.1