dot

packages and services management
Log | Files | Refs | README

commit d77723087cd0201f92a5ad8c755321e1ddcda033
parent c2d269e1cc34f13d372cf53a3ac2994dd74d3b6a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 23 Dec 2017 13:45:26 +0100

setup for dvtm-based workflow

Diffstat:
Dbin/attach | 24------------------------
Abin/dvtm-status | 16++++++++++++++++
Abin/io-abduco | 12++++++++++++
Mbin/suckless-patch-mail | 5++++-
Mbin/xdg-open | 3+++
Mdot/mpoprc | 2+-
Dpack/dvtm/build | 1-
Apack/dvtm/config.mk | 14++++++++++++++
8 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/bin/attach b/bin/attach @@ -1,24 +0,0 @@ -#!/bin/sh - -N=$ABDUCO_SOCKET_DIR/abduco/$USER/names - -# set the filename and the hash -[ $# = 1 ] && [ -e "$1" ] && set "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")" -hash=$(printf %s "$*" | cksum | cut -d ' ' -f 1) - -# remove terminated session from names list -abduco | sed 1d | cut -f 3 | xargs -I {} grep -F -e{} "$N" | sort -uo "$N" - -# only list session if no argument is given -[ $# = 0 ] && exec cut -f 2 "$N" - -# attach to session if arguments match a session name -cut -f 2 "$N" | grep -Fxq "$*" && exec "$*" - -printf '%s\t%s\n' "$hash" "$*" >> "$N" - -# execute commands if no file/dir of the same name exist -! [ -e "$1" ] && command -v "$1" > /dev/null && exec "$@" - -[ "$SSH_TTY" ] && e='^Z' || e='^\' -ABDUCO=$hash exec abduco -e "$e" -A "$hash" "$@" diff --git a/bin/dvtm-status b/bin/dvtm-status @@ -0,0 +1,16 @@ +#!/bin/sh + +FIFO="$HOME/var/run/dvtm-status.$$" + +[ -p "$FIFO" ] || mkfifo -m 600 "$FIFO" || exit 1 + +while true +do + printf '%s\n' "$(status)" > "$FIFO" + sleep 10 +done & PID=$! + +dvtm -s "$FIFO" "$@" 2> /dev/null +kill $PID +wait $PID 2> /dev/null +rm -f "$FIFO" diff --git a/bin/io-abduco b/bin/io-abduco @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ $# -gt 0 ] +then + name=$1 + shift +else + name=$({ printf '#'; abduco; } | iomenu -# -p abduco | cut -f4) +fi + +[ "$SSH_TTY" ] && e='^Z' || e='^\' +[ "$name" ] && ABDUCO=$name exec abduco -e "$e" -A "$name" "$@" diff --git a/bin/suckless-patch-mail b/bin/suckless-patch-mail @@ -1,3 +1,6 @@ #!/bin/sh -git send-email --subject-prefix="$(basename $(pwd))][PATCH" --to hackers@suckless.org -1 +git send-email -1 \ + --subject-prefix="$(basename $(pwd))][PATCH" \ + --to hackers@suckless.org \ + --smtp-server=$(command -v msmtp) diff --git a/bin/xdg-open b/bin/xdg-open @@ -4,6 +4,9 @@ tty | grep -q -e '^/dev/pts/.*' -e '^/dev/tty*' || exec st -f terminus:pixelsize=18 -e "$0" "$@" +[ -e "$1" ] && set -- "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" +printf '\033]0;%s\a' "$1" + #--- parse uri ----------------------------------------------------------------- # scheme://[user[:pass]@]host[:port][/path] diff --git a/dot/mpoprc b/dot/mpoprc @@ -2,7 +2,7 @@ defaults tls on tls_certcheck off tls_starttls off -uidls_file ~/var/run/mpop/%U +uidls_file ~.cache/mpop/%U account mail@josuah.net host mail.gandi.net diff --git a/pack/dvtm/build b/pack/dvtm/build @@ -1 +0,0 @@ -make CFLAGS=-D_BSD_SOURCE diff --git a/pack/dvtm/config.mk b/pack/dvtm/config.mk @@ -0,0 +1,14 @@ +# Customize below to fit your system + +PREFIX ?= /usr/local +MANPREFIX = ${PREFIX}/share/man +# specify your systems terminfo directory +# leave empty to install into your home folder +TERMINFO := ${DESTDIR}${PREFIX}/share/terminfo + +INCS = -I. +LIBS = -lc -lutil -lcurses +CPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE +CFLAGS += -std=c99 ${INCS} -DNDEBUG ${CPPFLAGS} + +CC ?= cc