aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-11-12 00:53:21 -0300
committerEuAndreh <eu@euandre.org>2022-11-12 00:53:21 -0300
commit9e65133659eb92c65c730b83d68c81e9d2df4251 (patch)
treebc0f53ff9737fe7ac6e492bc9463015f42f8536e
parentetc/guix/home.scm: Add "icedove" package (diff)
downloaddotfiles-9e65133659eb92c65c730b83d68c81e9d2df4251.tar.gz
dotfiles-9e65133659eb92c65c730b83d68c81e9d2df4251.tar.xz
Move email, IRC and Atom into Thunderbird
-rw-r--r--Makefile38
-rwxr-xr-xbin/m66
-rwxr-xr-xbin/mailcfg297
-rwxr-xr-xbin/update1
-rw-r--r--etc/guix/home.scm2
-rw-r--r--etc/mailcaps/config1
-rw-r--r--etc/sh/rc3
7 files changed, 1 insertions, 407 deletions
diff --git a/Makefile b/Makefile
index a9df1f2..036eda9 100644
--- a/Makefile
+++ b/Makefile
@@ -16,14 +16,7 @@ derived-assets = \
$(XDG_CONFIG_HOME)/ssh/id_rsa.pub \
$(XDG_CONFIG_HOME)/git/config-extra \
$(XDG_CONFIG_HOME)/gnupg/gpg-agent.conf \
- $(XDG_CONFIG_HOME)/remhind/config \
$(XDG_CONFIG_HOME)/ssh/config \
- $(XDG_CONFIG_HOME)/alot/config \
- $(XDG_CONFIG_HOME)/mbsync/config \
- $(XDG_CONFIG_HOME)/msmtp/config \
- $(XDG_CONFIG_HOME)/notmuch/default/config \
- $(XDG_CONFIG_HOME)/notmuch/default/hooks/post-new \
- $(XDG_DATA_HOME)/euandreh/mailcfg-accounts.txt \
$(XDG_DATA_HOME)/common-lisp/source \
$(XDG_DATA_HOME)/euandreh/e.list.txt \
$(lisp-images)
@@ -41,32 +34,10 @@ share/man/man1/z.1: bin/z
$(XDG_DATA_HOME)/common-lisp/source:
ln -s $(SRC)/libre $@
-$(XDG_CONFIG_HOME)/alot/config: bin/mailcfg
- mailcfg alot > $@
-
-$(XDG_CONFIG_HOME)/mbsync/config: bin/mailcfg
- mailcfg mbsync > $@
-
-$(XDG_CONFIG_HOME)/msmtp/config: bin/mailcfg
- mailcfg msmtp > $@
-
-$(XDG_CONFIG_HOME)/notmuch/default/config: bin/mailcfg
- mailcfg notmuchcfg > $@
-
-$(XDG_CONFIG_HOME)/notmuch/default/hooks/post-new: bin/mailcfg
- mailcfg notmuchhook > $@
- chmod +x $@
-
-$(XDG_DATA_HOME)/euandreh/mailcfg-accounts.txt: bin/mailcfg
- mailcfg list > $@
-
$(XDG_CONFIG_HOME)/ssh/id_rsa.pub:
gpg --export-ssh-key eu@euandre.org > $@
chmod 600 $@
-$(XDG_CONFIG_HOME)/remhind/config: $(XDG_CONFIG_HOME)/remhind/config.tmpl
- envsubst < $(XDG_CONFIG_HOME)/remhind/config.tmpl > $@
-
$(XDG_CONFIG_HOME)/ssh/config: $(XDG_CONFIG_HOME)/ssh/config.tmpl
envsubst < $(XDG_CONFIG_HOME)/ssh/config.tmpl > $@
@@ -114,13 +85,6 @@ check-dirty-public:
exit 1; \
fi
-check-dirty-private:
- if ! git -C $(PRIV_CONFIG) diff --quiet || \
- ! git -C $(PRIV_CONFIG) diff --quiet --staged; then \
- printf 'Dirty private tilde repository.\n' >&2; \
- exit 1; \
- fi
-
check-opt:
find opt/tests/ -name '*.sh' -exec {} +
@@ -134,7 +98,7 @@ check-sync:
fi
check: check-shellcheck check-perlcritic check-fixme check-dirty-public \
- check-dirty-private check-opt check-pod check-sync
+ check-opt check-pod check-sync
clean:
rm -f $(derived-assets)
diff --git a/bin/m b/bin/m
deleted file mode 100755
index 6891128..0000000
--- a/bin/m
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-set -eu
-
-usage() {
- cat <<-'EOF'
- Usage:
- m
- m -h
- EOF
-}
-
-help() {
- cat <<-'EOF'
-
- Options:
- -h, --help show this message
-
-
- Fetch email via IMAP and update the notmuch index.
-
-
- Examples:
-
- Just fetch email
-
- $ m
- EOF
-}
-
-
-for flag in "$@"; do
- case "$flag" in
- --)
- break
- ;;
- --help)
- usage
- help
- exit
- ;;
- *)
- ;;
- esac
-done
-
-while getopts 'h' flag; do
- case "$flag" in
- h)
- usage
- help
- exit
- ;;
- *)
- usage >&2
- exit 2
- ;;
- esac
-done
-shift $((OPTIND - 1))
-
-
-F="${XDG_DATA_HOME:-$HOME/.local/share}"/euandreh/mailcfg-accounts.txt
-
-notmuch new
-xargs -I% -P "$(wc -l < "$F")" mbsync '%' < "$F"
-notmuch new
diff --git a/bin/mailcfg b/bin/mailcfg
deleted file mode 100755
index f77355e..0000000
--- a/bin/mailcfg
+++ /dev/null
@@ -1,297 +0,0 @@
-#!/bin/sh
-# shellcheck disable=1090,2153
-set -eu
-
-usage() {
- cat <<-'EOF'
- Usage:
- mailcfg ACTION
- mailcfg -h
- EOF
-}
-
-help() {
- cat <<-'EOF'
-
- Options:
- -h, --help show this message
-
- ACTION one of:
- - mbsync
- - msmtp
- - notmuchcfg
- - notmuchhook
- - alot
- - list
-
-
- Emit the generated configuration file for the chosen email
- program. Get the configuration files from
- $XDG_CONFIG_HOME/mailcfg/*.env, where every *.env file is a
- shell script that defines the variables used in this program:
- - $NAME
- - $LABEL
- - $IMAP
- - $SMTP
- - $ADDR
-
- One of the files also needs to define:
- - $DEFAULT_NAME
- - $DEFAULT_ADDR
- - $DEFAULT_LABEL
-
- An example of such file could be "30-andre@work.com.env":
-
- #!/bin/sh
- set -eu
-
-
- NAME='André!'
- LABEL='Work'
- IMAP='imap.work.com'
- SMTP='smtp.work.com'
- ADDR='andre@work.com'
-
-
- Examples:
-
- Get the alot configuration file:
-
- $ mailcfg alot
-
-
- List the existing account labels:
-
- $ mailcfg list
- EOF
-}
-
-
-for flag; do
- case "$flag" in
- --)
- break
- ;;
- --help)
- usage
- help
- exit
- ;;
- *)
- ;;
- esac
-done
-
-while getopts 'h' flag; do
- case "$flag" in
- h)
- usage
- help
- exit
- ;;
- *)
- usage >&2
- exit 2
- ;;
- esac
-done
-shift $((OPTIND - 1))
-
-ACTION="${1:-}"
-eval "$(assert-arg "$ACTION" 'ACTION')"
-
-CFGDIR="${XDG_CONFIG_HOME:-$HOME/.config}/mailcfg"
-
-
-mbsync() {
- cat <<-'EOF'
- SyncState *
- Create Both
- Expunge Both
- Remove Both
- Sync All
- EOF
-
- for env in "$CFGDIR"/*.env; do
- . "$env"
- cat <<-EOF
-
-
- ## $LABEL
-
- IMAPAccount $LABEL
- Host $IMAP
- User $ADDR
- PassCmd "pass show $ADDR"
- SSLType IMAPS
-
- IMAPStore ${LABEL}Remote
- Account $LABEL
-
- MaildirStore ${LABEL}Local
- Path ~/Maildir/$LABEL/
- Inbox ~/Maildir/$LABEL/INBOX
- SubFolders Verbatim
-
- Channel ${LABEL}Folders
- Far :${LABEL}Remote:
- Near :${LABEL}Local:
- Patterns *
-
- Group $LABEL
- Channel ${LABEL}Folders
- EOF
- done
-}
-
-msmtp() {
- cat <<-EOF
- defaults
- auth on
- tls on
- port 587
- syslog on
- logfile $XDG_LOG_HOME/msmtp.log
- EOF
-
- for env in "$CFGDIR"/*.env; do
- . "$env"
- cat <<-EOF
-
- account $LABEL
- host $SMTP
- from $ADDR
- user $ADDR
- passwordeval pass show $ADDR
- EOF
- done
-
- cat <<-EOF
-
- account default : $DEFAULT_LABEL
- EOF
-}
-
-notmuchcfg() {
- for env in "$CFGDIR"/*.env; do
- . "$env"
- done
-
- cat <<-EOF
- [user]
- name = $DEFAULT_NAME
- primary_email = $DEFAULT_ADDR
- EOF
-
- printf 'other_email = '
- for env in "$CFGDIR"/*.env; do
- . "$env"
- if [ "$ADDR" = "$DEFAULT_ADDR" ]; then
- continue
- fi
- echo "$ADDR"
- done | paste -sd';'
-
- cat <<-'EOF'
-
- [new]
- tags = new;
- ignore = .mbsyncstate;.uidvalidity
-
- [search]
- exclude_tags = deleted;spam
-
- [maildir]
- synchronize_flags = true
- EOF
-}
-
-notmuchhook() {
- LABELS=''
- for env in "$CFGDIR"/*.env; do
- . "$env"
- if [ -z "$LABELS" ]; then
- LABELS="$LABEL"
- else
- LABELS="$LABELS $LABEL"
- fi
- done
- sed \
- -e "s|@DIRS@|$LABELS|g" \
- -e "s|@DEFAULT_LABEL@|$DEFAULT_LABEL|g" \
- "$CFGDIR"/post-new
-}
-
-alot() {
- cat <<-'EOF'
- attachment_prefix = "~/Downloads/"
-
- [bindings]
- i = toggletags inbox
- I = search folder:/INBOX/ AND NOT tag:killed AND NOT tag:archive
- EOF
- echo "
- z archive
- s spam
- u unread
- r keep
- t track
- " | while read -r l; do
- if [ -z "$l" ]; then
- continue
- fi
- LC="$( echo "$l" | cut -d' ' -f1)"
- TAG="$(echo "$l" | cut -d' ' -f2)"
- UC="$(echo "$LC" | tr '[:lower:]' '[:upper:]')"
- cat <<-EOF
- $LC = toggletags $TAG
- $UC = search tag:$TAG AND NOT tag:killed
- EOF
- done
-
- cat <<-'EOF'
- M = search folder:/lists/ AND NOT tag:killed
- m = compose --tags inbox
- [[thread]]
- v = pipeto urlscan 2>/dev/null
- V = pipeto 'gpg -d | less'
- r = reply --all
- R = reply
- ' ' = fold; untag unread; move next unfolded
- P = pipeto 'git am'
-
- [accounts]
- EOF
-
- for env in "$CFGDIR"/*.env; do
- . "$env"
- cat <<-EOF
- [[$LABEL]]
- realname = $NAME
- address = $ADDR
- sendmail_command = msmtpq --account=$LABEL -t
- sent_box = maildir://~/Maildir/$LABEL/Sent
- draft_box = maildir://~/Maildir/$LABEL/Drafts
- gpg_key = 5BDAE9B8B2F6C6BCBB0D6CE581F90EC3CD356060
- EOF
- done
-}
-
-list() {
- for env in "$CFGDIR"/*.env; do
- . "$env"
- printf '%s\n' "$LABEL"
- done
-}
-
-
-case "$ACTION" in
- mbsync|msmtp|notmuchcfg|notmuchhook|alot|list)
- "$1"
- ;;
- *)
- printf 'Unsupported ACTION: "%s".\n\n' "$ACTION" >&2
- usage >&2
- exit 2
- ;;
-esac
diff --git a/bin/update b/bin/update
index 11ac73d..26bd5c7 100755
--- a/bin/update
+++ b/bin/update
@@ -74,7 +74,6 @@ guix pull &
wait
rfc -u
-newsboat -x reload
repos -e ~/dev/go/ -e ~/dev/quicklisp/ -e ~/dev/archive/ ~/dev/ |
xargs -I% -P4 x \
diff --git a/etc/guix/home.scm b/etc/guix/home.scm
index 3bf9f3e..79bb1c1 100644
--- a/etc/guix/home.scm
+++ b/etc/guix/home.scm
@@ -227,9 +227,7 @@
(define cronjobs
(list
- #~(job "0 0 * * *" "cronjob msmtp-queue -r")
#~(job "0 0 * * *" "cronjob check")
- #~(job "5 */6 * * *" "cronjob m")
#~(job "30 0 * * *" "cronjob x update AND upgrade")
#~(job "30 0 * * *" "cronjob backup -q cron")))
diff --git a/etc/mailcaps/config b/etc/mailcaps/config
deleted file mode 100644
index 60f7286..0000000
--- a/etc/mailcaps/config
+++ /dev/null
@@ -1 +0,0 @@
-text/html; env HOME=$XDG_DATA_HOME/w3m w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput
diff --git a/etc/sh/rc b/etc/sh/rc
index 742975c..44e8efb 100644
--- a/etc/sh/rc
+++ b/etc/sh/rc
@@ -53,9 +53,7 @@ export GUILE_HISTORY="$XDG_STATE_HOME/guile-history"
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
export RLWRAP_HOME="$XDG_CACHE_HOME/rlwrap"
export LESSHISTFILE="$XDG_STATE_HOME/lesshst"
-export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/default/config"
export PASSWORD_STORE_DIR="$SRC/private/password-store"
-export MAILCAPS="$XDG_CONFIG_HOME/mailcaps/config"
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc.py"
export EXINIT='
" set number
@@ -108,7 +106,6 @@ unalias -a
alias p='ping euandre.org -c 3'
alias c='tmux send-keys -R \; clear-history'
alias o='open'
-alias mm='msmtp-queue -r'
alias s='vcs status'
alias d='vcs diff'
alias ds='vcs diff -- --staged'