From 243ced7c46e63260f3027587272736b2b660fb7c Mon Sep 17 00:00:00 2001 From: "yakumo.izuru" Date: Sat, 8 Apr 2023 00:26:50 +0000 Subject: [PATCH] Orin, go! Signed-off-by: Izuru Yakumo git-svn-id: file:///srv/svn/repo/rin/trunk@1 5f6c6692-7da8-c640-9b4f-fb22b0af4e5b --- COPYING | 4 ++++ Makefile | 9 +++++++++ README | 8 ++++++++ rin | 47 +++++++++++++++++++++++++++++++++++++++++++++++ rin.1 | 29 +++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 COPYING create mode 100644 Makefile create mode 100644 README create mode 100644 rin create mode 100644 rin.1 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..9d27966 --- /dev/null +++ b/COPYING @@ -0,0 +1,4 @@ +Freedom License v1 (2021年08月17日) + +全く無限的自由です。 +It's infinite freedom. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bcdf6b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +PREFIX ?= /usr/local + +install: + install -Dm0755 rin ${PREFIX}/bin/rin + install -Dm0600 rin.1 ${PREFIX}/man/man1/rin.1 +uninstall: + rm -f ${PREFIX}/bin/rin + rm -f ${PREFIX}/man/man1/rin.1 + diff --git a/README b/README new file mode 100644 index 0000000..d547241 --- /dev/null +++ b/README @@ -0,0 +1,8 @@ +Rin (燐) + +Usage: +rin clean +rin compose +rin fetch +rin list +rin read diff --git a/rin b/rin new file mode 100644 index 0000000..227f024 --- /dev/null +++ b/rin @@ -0,0 +1,47 @@ +#!/bin/sh +# rin - my personal e-mail assistant in posix shell +# it's a wrapper over fdm(1) and mblaze(7) adapted to my setup +# which can be found on https://gt.kalli.st/novaburst/home-v2 + +# Source code: https://git.076.ne.jp/novaburst/mailutils-sh + +# Clean-up the Maildir directory +# Arguments: +fn_clean() { + find "$@"/cur -type f -print -delete +} +# Compose/write an e-mail +# This is just here for some reason +fn_compose() { + mcom +} +# Fetch e-mails from remote server +# Arguments: +fn_fetch() { + fdm -a "$@" fetch +} +# List messages on a Maildir +# Arguments: +fn_list() { + minc -q "$@" + mlist -s "$@" | msort -dr | mthread -r | mseq -S | mscan +} +# Read a message +# Arguments: +fn_read() { + mless "$2" +} +# Print an usage note +# Triggered if the assistant is called without any arguments. +fn_usage() { + printf "Usage: \n" + printf "%s [ clean | compose | fetch | list | read ] \n" "$(basename $0)" +} +case $1 in + clean | -c) fn_clean "$2" ;; + compose | -w) fn_compose ;; + fetch | -f) fn_fetch "$2" ;; + list | -l) fn_list "$2" ;; + read | -r) fn_read "$2" ;; + *) fn_usage ;; +esac diff --git a/rin.1 b/rin.1 new file mode 100644 index 0000000..efe5458 --- /dev/null +++ b/rin.1 @@ -0,0 +1,29 @@ +.Dd June 9, 2022 +.Dt RIN 1 +.Os +.Sh NAME +.Nm rin +.Nd My personal e-mail assistant +.Sh DESCRIPTION +It's a wrapper over +.Xr fdm 1 +and +.Xr mblaze 7 +adapted to my setup +.Sh USAGE +.Bl -tag -width 11n -compact +.It clean, -c +Clean-up a Maildir directory +.It compose, -w +Compose/write an e-mail +.It fetch, -f +Fetch e-mails from remote server +.It list, -l +List messages on a Maildir +.It read, -r +Read a message +.El +.Sh SEE ALSO +.Lk https://gt.kalli.st/novaburst/home-v2 +.Sh AUTHORS +.An Aoi Koizumi Aq Mt novaburst@kalli.st