dot

packages and services management
Log | Files | Refs | README

commit bd243ba43a39fbe8b3057ce4e9a40803826fc7f5
parent c6f3b8598c32efd0884f15a6e1c7ec7414005cad
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 21 Nov 2018 02:42:30 +0100

Merge branch 'master' of file:///var/git/dot

Diffstat:
Mbin/mail-flag | 2+-
Mbin/mail-list | 6+++---
Mbin/mail-new | 2+-
Mbin/mail-print | 2+-
Mbin/mail-rep | 2+-
Mbin/mail-sort | 25++++++++++++-------------
Mbin/menu | 7+++++--
Abin/menu-mail | 12++++++++++++
Mbin/pass | 8++------
Mbin/shortcut | 2+-
Dconf/gpg | 6------
Aconf/gpg-export | 4++++
Aconf/gpg-import | 6++++++
As6/tapio/client/run | 11+++++++++++
As6/tapio/server/env/HOST | 1+
As6/tapio/server/run | 10++++++++++
As6/tapio/x/env/IFACE | 1+
As6/tapio/x/env/MODE | 1+
As6/tapio/x/env/PORT | 1+
As6/tapio/x/type | 1+
20 files changed, 75 insertions(+), 35 deletions(-)

diff --git a/bin/mail-flag b/bin/mail-flag @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb -backtick x { dollarat -d "\n" } importas -s -d "\n" @ x +elgetpositionals mflag $@ diff --git a/bin/mail-list b/bin/mail-list @@ -1,9 +1,9 @@ #!/usr/bin/env execlineb -backtick -n x { whoami } importas user x -backtick -n x { homeof $user } importas home x +backtick -n x { whoami } importas USER x +backtick -n x { homeof $USER } importas HOME x multisubstitute { importas -D INBOX INBOX 1 - importas -D ${home}/mail MAILDIR MAILDIR + importas -D ${HOME}/mail MAILDIR MAILDIR define FORMAT "\\n%c%4n %i%s\\n %t%u %i%D %40f" } diff --git a/bin/mail-new b/bin/mail-new @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb -backtick x { dollarat -d "\n" } importas -s -d "\n" @ x +elgetpositionals mcom $@ diff --git a/bin/mail-print b/bin/mail-print @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb -backtick x { dollarat -d "\n" } importas -s -d "\n" @ x +elgetpositionals mshow $@ diff --git a/bin/mail-rep b/bin/mail-rep @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb -backtick x { dollarat -d "\n" } importas -s -d "\n" @ x +elgetpositionals mrep $@ diff --git a/bin/mail-sort b/bin/mail-sort @@ -1,29 +1,28 @@ #!/usr/bin/env execlineb - -backtick -n x { whoami } importas user x -backtick -n x { homeof $user } importas home x +backtick -n x { whoami } importas USER x +backtick -n x { homeof $USER } importas HOME x multisubstitute { - importas -D ${home}/.mblaze mblaze MBLAZE - importas -D INBOX inbox 1 - importas -D ${home}/mail maildir MAILDIR + importas -D ${HOME}/.mblaze MBLAZE MBLAZE + importas -D INBOX INBOX 1 + importas -D ${HOME}/mail MAILDIR MAILDIR } -cd $maildir +cd $MAILDIR fdmove -c 1 2 -forbacktickx -n x { ls ${mblaze}/sort } importas target x -if { mkdir -p "$target/cur" "$target/new" "$target/tmp" } -if { printf '%-35s ' "$target" } +forbacktickx -n x { ls ${MBLAZE}/sort } importas target x +if { mkdir -p ${target}/cur ${target}/new ${target}/tmp } +if { fdmove -c 1 2 printf "%-35s " $target } backtick -n x { - pipeline { cat ${mblaze}/sort/${target} } + pipeline { cat ${MBLAZE}/sort/${target} } tr "\n" " " } importas rule x forbacktickx -n x { - pipeline { mlist $inbox } - mpick -t $rule + pipeline { mlist $INBOX } + mpick -v -t $rule } importas file x if { test ${file} != ${target}/new } mv $file ${target}/new diff --git a/bin/menu b/bin/menu @@ -1,3 +1,6 @@ -#!/bin/sh -e +#!/usr/bin/env execlineb +importas DISPLAY DISPLAY -test "$DISPLAY" && exec dmenu -fn terminus -nf '#fff' -nb '#222' -sf '#222' -sb '#fff' -l 40 || exec iomenu +ifelse { test -z "$DISPLAY" } { iomenu } + +dmenu -fn terminus -nf "#fff" -nb "#222" -sf "#222" -sb "#fff" -l 40 diff --git a/bin/menu-mail b/bin/menu-mail @@ -0,0 +1,12 @@ +#!/usr/bin/env execlineb +backtick -n x { whoami } importas user x +backtick -n x { homeof $user } importas home x +multisubstitute { + importas -D ${home}/.mblaze mblaze MBLAZE + importas -D INBOX inbox 1 + importas -D ${home}/mail maildir MAILDIR +} + +backtick -n x { pipeline { ls $maildir } menu } importas dir x + +mail-list $dir diff --git a/bin/pass b/bin/pass @@ -1,9 +1,5 @@ #!/bin/sh -e -PASS=${PASS:-/mnt/key/pass/} +cd "${PASS:-/mnt/key/pass/}" -if [ $# = 0 ]; then - exec ls "$PASS" -else - exec cat "$PASS/$1" -fi +[ $# = 0 ] && exec find * -type f || exec cat "$1" diff --git a/bin/shortcut b/bin/shortcut @@ -3,7 +3,7 @@ case "$1" in (u) exec menu-uri ;; (s) exec menu-session ;; -(m) exec menu-mblaze ;; +(m) exec menu-mail ;; (o) exec menu-open ;; (t) exec menu-ssh ;; (p) exec menu-pass ;; diff --git a/conf/gpg b/conf/gpg @@ -1,6 +0,0 @@ -#!/bin/sh -ex - -mkdir -p "$HOME/.gnupg" -cp -f /mnt/key/gpg/pubring.gpg "$HOME/.gnupg/pubring.gpg" -cp -f /mnt/key/gpg/secring.gpg "$HOME/.gnupg/secring.gpg" -cp -f /mnt/key/gpg/trustdb.gpg "$HOME/.gnupg/trustdb.gpg" diff --git a/conf/gpg-export b/conf/gpg-export @@ -0,0 +1,4 @@ +#!/bin/sh -ex + +cd "$HOME/.gnupg" +cp -rf "private-keys-v1.d" pubring.kbx /mnt/key/gpg diff --git a/conf/gpg-import b/conf/gpg-import @@ -0,0 +1,6 @@ +#!/bin/sh -ex + +mkdir -p "$HOME/.gnupg" +cd "$HOME/.gnupg" +gpg2 --import /mnt/key/gpg/pubring.kbx +cp /mnt/key/gpg/trustdb.gpg . diff --git a/s6/tapio/client/run b/s6/tapio/client/run @@ -0,0 +1,11 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 s6-envdir env multisubstitute { + importas HOST HOST + importas PORT PORT + importas IFACE IFACE + importas MODE MODE +} + +s6-tcpclient $HOST $PORT +fdmove 0 6 fdmove 1 7 +tapio $IFACE mode $MODE diff --git a/s6/tapio/server/env/HOST b/s6/tapio/server/env/HOST @@ -0,0 +1 @@ +0.0.0.0 diff --git a/s6/tapio/server/run b/s6/tapio/server/run @@ -0,0 +1,10 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 s6-envdir env multisubstitute { + importas HOST HOST + importas PORT PORT + importas MODE MODE + importas IFACE IFACE +} + +s6-tcpserver $HOST $PORT +tapio $IFACE mode $MODE diff --git a/s6/tapio/x/env/IFACE b/s6/tapio/x/env/IFACE @@ -0,0 +1 @@ +tun0 diff --git a/s6/tapio/x/env/MODE b/s6/tapio/x/env/MODE @@ -0,0 +1 @@ +tun diff --git a/s6/tapio/x/env/PORT b/s6/tapio/x/env/PORT @@ -0,0 +1 @@ +5555 diff --git a/s6/tapio/x/type b/s6/tapio/x/type @@ -0,0 +1 @@ +longrun