dot

packages and services management
Log | Files | Refs | README

commit d8c99934a984132dad186b80edb8624ba38a362f
parent b43507d3e744845de1146b6af845463f0071a1c2
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon, 11 Dec 2017 12:52:16 +0100

gopher paster

Diffstat:
Abin/bitreich-paste | 13+++++++++++++
Mbin/ii-client | 11+++++++++--
Abin/paste | 5+++++
Mdot/profile | 2+-
4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/bin/bitreich-paste b/bin/bitreich-paste @@ -0,0 +1,13 @@ +#!/bin/sh + +DST="josuah@bitreich.org" +DSTDIR="/bitreich/gopher/paste" + +cat "$@" | ssh "$DST" ' + set -e + cd '"'$DSTDIR'"' + tmp="$(mktemp "p-XXXXXX.txt")" + cat > "$tmp" + chmod g+rw "$tmp" + echo "$tmp" +' | xargs printf 'gopher://bitreich.org/0/p/%s\n' | tee /dev/stderr | xclip diff --git a/bin/ii-client b/bin/ii-client @@ -1,8 +1,12 @@ #!/bin/sh -# Simple tiny ii client +# Simple tiny ii client using eel(1) and iomenu(1). +IRCPATH=$HOME/irc INPUT=$HOME/.cache/ii-client +[ $# -eq 0 ] && exec "$0" "$(find "$IRCPATH" -type d | iomenu)" +clear + tail -f "$1/out" | eel | while IFS='' read -r line do printf '\r\033[K%s\n> %s' "$line" "$(cat "$INPUT")" done & @@ -22,6 +26,9 @@ do (014) # Ctrl + L tail -n 1000 "$1/out"| eel | less ;; + (016) # Ctrl + N + exec "$0" "$(find "$IRCPATH" -type d | iomenu)" + ;; (025) # Ctrl + U printf '' > "$INPUT" ;; @@ -32,7 +39,7 @@ do printf %s "$(sed 's/.$//' "$INPUT")" > "$INPUT" ;; (*) - if [ "$key" -gt 41 ] && [ "$key" -lt 177 ] || [ "$key" -eq 40 ] + if [ "$key" -ge 41 ] && [ "$key" -lt 177 ] || [ "$key" -eq 40 ] then printf "\\$key" >> "$INPUT" fi ;; diff --git a/bin/paste b/bin/paste @@ -0,0 +1,5 @@ +#!/bin/sh + +cat "$@" | ssh josuah@josuah.net ' + cd srv/p && tmp=$(mktemp XXXXX.txt) && cat > "$tmp" && echo "$tmp" +' | xargs printf 'gopher://josuah.net/0/p/%s\n' diff --git a/dot/profile b/dot/profile @@ -25,7 +25,7 @@ export LC_TIME=en_US.UTF-8 export ABDUCO_SOCKET_DIR="$HOME/.cache" -export LESS="-~RN" +export LESS="-~R" export BLIH="josuah.demangeon@epitech.eu" export CVSROOT="anoncvs@anoncvs.fr.openbsd.org:/cvs"