dot

packages and services management
Log | Files | Refs | README

commit 8a7813b8f671c50365e85789399d96d66632b15e
parent f9f05e9a29c6ad495ae622aab2dd462f02c26b0f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 11 Apr 2017 11:11:49 +0200

no color escape code, please

Diffstat:
M.profile | 2+-
Mbin/git-status | 18+++++++-----------
Mbin/madown | 7+++++--
Mbin/mb-all | 14++++++++++++--
Mbin/version | 5++---
5 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/.profile b/.profile @@ -29,7 +29,7 @@ PS1=' $( error="$?" printf "%s" "$PWD/" "$(git-status)" "${ABDUCO:+ $ABDUCO}" "${SSH_TTY:+ $(hostname)}" - [ "$error" -gt 0 ] && printf " \033[1;31m%s\033[m" "$error" + [ "$error" -gt 0 ] && printf " %s" "$error" ) $ ' PS2=': ' diff --git a/bin/git-status b/bin/git-status @@ -30,16 +30,12 @@ git rev-parse 2> /dev/null && git status --porcelain -b | awk ' /^[^ ]. / { staged++; } END { - printf(" %s\033[m", branch); + printf(" %s", branch); - if (untracked + conflicts + changed + staged + behind + ahead == 0) { - printf " \033[1;32mo\033[m"; - } else { - if (untracked) printf " \033[1;33m?\033[m%d", untracked; - if (conflicts) printf " \033[1;31m!\033[m%d", conflicts; - if (changed ) printf " \033[1;32m+\033[m%d", changed; - if (staged ) printf " \033[1;34m*\033[m%d", staged; - if (behind ) printf " \033[1;35mv\033[m%d", behind; - if (ahead ) printf " \033[1;36m^\033[m%d", ahead; - } + if (untracked) printf(" ?%d", untracked); + if (conflicts) printf(" !%d", conflicts); + if (changed ) printf(" +%d", changed); + if (staged ) printf(" *%d", staged); + if (behind ) printf(" v%d", behind); + if (ahead ) printf(" ^%d", ahead); }' diff --git a/bin/madown b/bin/madown @@ -2,7 +2,6 @@ awk ' BEGIN { head = 1; - tag = "p"; } @@ -99,9 +98,13 @@ tag != "li" && previous == "li" { while (sub(/*/, "<strong>")) sub(/*/, "</strong>"); + # links + while (sub(/\[/, "<a href=\"")) + sub(/]/, "\">@</a>"); + printf("<%s>%s</%s>\n", tag, $0, tag); previous = tag; tag = ""; } -' +' "$@" diff --git a/bin/mb-all b/bin/mb-all @@ -1,4 +1,14 @@ # list mail from all inboxes using mblaze -mdirs "$MAIL" | xargs mlist | msort -r -d | mseq -S | mscan | -$PAGER +# get the main mail directory with all mailing lists +printf %s "$MAIL" | xargs dirname | + +# find all mailboxes in it +xargs -I % find % -type d -mindepth 1 ! -name cur ! -name new ! -name tmp | + +# pick one from it, generate a list of mails +iomenu -l 255 | xargs mdirs | mlist | msort -r -d | mseq -S | + +# show it in a pager +mscan -f '%6n %D %u %t%2i%120S' | less -S + diff --git a/bin/version b/bin/version @@ -39,10 +39,9 @@ new() { printf 'making a new revision\n' - find . -type f ! -path './v/*' | sort | xargs $SUM | tee v/tmp | + find . -type f ! -path './v/*' | sort | xargs $SUM | tee v/tmp | sed 's/ /\n/' | xargs -n 2 cp while read -r hash path - do - test -f "v/obj/$hash" || cp "$path" "v/obj/$hash" + [ -f "v/obj/$hash" ] || cp "$path" "v/obj/$hash" done mv -f v/tmp "v/rev/$($SUM v/tmp | cut -d ' ' -f 1 | tee -a v/log)"