shithub: rc

Download patch

ref: 642094652c3cd0bd8d00853c477f1de1ff768b69
parent: e2b661c01fb02714b4a5e2e8d43e3c5cea8f2db1
author: qwx <qwx@sciops.net>
date: Mon Sep 6 22:57:38 EDT 2021

add mailrio: mailbox subrio

--- /dev/null
+++ b/bin/mailrio
@@ -1,0 +1,32 @@
+#!/bin/rc -e
+rfork n
+if(! ~ $#* 2){
+	echo usage: $0 mbox upasname >[1=2]
+	exit usage
+}
+upas/fs -f $1 >>[2]/tmp/mailrio.log || exit
+upasname=$2
+wsz=`{read -c 48 /mnt/wsys/wctl}
+facerect=( \
+	0 \
+	0 \
+	`{echo $wsz(3) - $wsz(1) | pc -n} \
+	116 \
+)
+unmount /mnt/plumb
+plumbsrv=()
+plumber
+cat <<! >/tmp/mailrio.$pid
+#!/bin/rc
+window -r $facerect faces -i
+!
+chmod +x /tmp/mailrio.$pid
+rio -i /tmp/mailrio.$pid
+rm /tmp/mailrio.$pid
+unmount /mail/fs
+unmount /mnt/plumb
+# fuck you rc
+if(! ~ $#plumbsrv 0)
+	rm $plumbsrv
+if not
+	die plumber $pid