dot

packages and services management
Log | Files | Refs | README

commit d34b0b65a078eb184fb67e9d1a678ae2260496c7
parent bf62c42d1f225f86cfa2958019e521575dc973b6
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 29 Apr 2017 14:31:02 +0200

trying to fix io-ii-less, added fig-fullwidtg

Diffstat:
Abin/fig-fullwidth | 10++++++++++
Mbin/ii-filter | 8++++----
Abin/io-ii | 30++++++++++++++++++++++++++++++
Dbin/io-ii-less | 12------------
Mbin/io-run | 5++---
Mbin/io-url | 2+-
Murl | 3+++
7 files changed, 50 insertions(+), 20 deletions(-)

diff --git a/bin/fig-fullwidth b/bin/fig-fullwidth @@ -0,0 +1,10 @@ +# Fullwidth letters + +printf '%s\n' "$*" | +sed ' + y/!"#$%&'\''()*+,-.\/0123456789:;<=>?/!"#$%&'()*+,-./0123456789:;<=>?/ + y/@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_/@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_/ + y/`abcdefghijklmnopqrstuvwxyz{|}~/`abcdefghijklmnopqrstuvwxyz{|}~/ + s/ / /g +' + diff --git a/bin/ii-filter b/bin/ii-filter @@ -38,22 +38,22 @@ BEGIN { if (nick != lastnick) printf("%-" NICK_COL "s│\n", date); - printf("%" NICK_COL "s│", + printf("%" NICK_COL "s│ ", (nick != lastnick && nick != "-!-") ? nick : ""); for (first = 1; length($0) >= TEXT_COL; first = 0) { line = substr($0, 1, TEXT_COL); sub(/ [^ ]*$/, "", line); - $0 = substr($0, length(line) + 2); + $0 = substr($0, length(line) + 1); if (!first) - printf("%" NICK_COL "s│", ""); + printf("%" NICK_COL "s│ ", ""); print(line); } if (!first) - printf("%" NICK_COL "s│", ""); + printf("%" NICK_COL "s│ ", ""); print($0); diff --git a/bin/io-ii b/bin/io-ii @@ -0,0 +1,30 @@ +# a pager to browse ii channels + +T=' ' +name='.' + +while [ "$name" ] +do + name="$( + { + printf '# Read\n' + find "${IRC:-$HOME/var/irc}" -mindepth 1 -type d + + printf '# Talk\n' + find "${IRC:-$HOME/var/irc}" -mindepth 1 -type d + } | iomenu -p ii -s -h + )" + mode="${name%%$T*}" + name="${name#*$T}" + + if [ -z "${mode### Read}" ] && [ -f "$name/out" ] + then + less "$name/out" + + elif [ -z "${mode### Talk}" ] && [ -p "$name/in" ] + then + printf '\033[7m message \033[m '; read message + [ "$message" ] && printf '%s\n' "$message" >> "$dir/in" + fi +done + diff --git a/bin/io-ii-less b/bin/io-ii-less @@ -1,12 +0,0 @@ -# a pager to browse ii channels - -name='.' - -while [ "$name" ] -do - name="$( - find "${IRC:-$HOME/var/irc}" -mindepth 1 -type d | iomenu -p ii - )" - - [ -f "$name/out" ] && tail -f -n 512 "$name/out" | ii-filter | less -done diff --git a/bin/io-run b/bin/io-run @@ -4,7 +4,7 @@ CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/io" -# --- cache -------------------------------------------------------------------- +# --- commands cache ----------------------------------------------------------- IFS=':' @@ -30,8 +30,7 @@ command="$({ cat "$CACHE/run" } | iomenu -s -p run )" -name="$(printf %s "$command" | sed 's|/|!|')" +name="$(printf %s "$command" | sed 's|/|!|g')" [ "$SSH_TTY" ] && e='^\' || e='^Z' -command -v "${command%% *}" && ABDUCO="$name" exec abduco -e "$e" -A "$name" $command diff --git a/bin/io-url b/bin/io-url @@ -10,7 +10,7 @@ case "$url" in ;; ( ssh://* ) ABDUCO="$name" exec abduco -e "$e" -A "$name" \ - ssh "$url" + ssh "${url#ssh://}" ;; ( gopher://* ) ABDUCO="$name" exec abduco -e "$e" -A "$name" \ diff --git a/url b/url @@ -28,3 +28,6 @@ irc://irc.cyberia.is # Gopher gopher://bitreich.org + +# SSH +ssh://josuah@josuah.net