citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 501d63e5c35f5e4f266dae41204796bc8313d4c8
parent 455c49e58fa393d214370e868756c441361c2f67
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 17 Jul 2023 18:06:27 -0700

Merge remote-tracking branch 'origin/master'

Diffstat:
Abin/bolt11 | 16++++++++++++++++
Mbin/email-conn-test | 2+-
Mbin/general-status | 13+++++++++++--
Mbin/nix-install | 2+-
Mdotfiles/.config/neomutt/neomuttrc | 25++++++++++---------------
Mdotfiles/.gitconfig | 4++++
Adotfiles/.notmuch-config | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdotfiles/commands | 8++++++++
8 files changed, 173 insertions(+), 19 deletions(-)

diff --git a/bin/bolt11 b/bin/bolt11 @@ -0,0 +1,16 @@ +res=$(lcli decode "$@") + +echo "$res" + +<<<"$res" jq -r '.created_at' | xargs -I{} datediff -f '%Hh %Mm %Ss created ago' -i '%s' now {} +<<<"$res" jq -r '.created_at + .expiry' | xargs -I{} datediff -f '%Hh %Mm %Ss until expiry' -i '%s' now {} + +amount=$(<<<"$res" jq -r .amount_msat) + +if [[ $amount == "null" ]] +then + echo "any amount" +else + bcalc "$amount msat to sats" +fi + diff --git a/bin/email-conn-test b/bin/email-conn-test @@ -1,2 +1,2 @@ #!/usr/bin/env sh -exec nc -w 1 -vz jb55.com 12566 +nc -w 1 -vz jb55.com 12566 diff --git a/bin/general-status b/bin/general-status @@ -10,15 +10,24 @@ git_status () { fi } +mail_status() { + queued=$(msmtp-queue 2>&1| grep '^\s*mail' | wc -l) + if [[ $queued -gt 0 ]] + then + echo "${queued}x📤" + fi +} + USR="" if [ "$USER" != "jb55" ]; then USR="$USER " fi -printf "%s%s %s\n" \ +printf "%s%s %s %s\n" \ "$USR" \ "$PWD" \ - "$(git_status)" + "$(git_status)" \ + "$(mail_status)" #if git rev-parse --is-inside-work-tree >/dev/null 2>/dev/null; then # printf "\n" diff --git a/bin/nix-install b/bin/nix-install @@ -1,2 +1,2 @@ #!/usr/bin/env bash -exec nix-env -f $NIXPKGS -Q --max-jobs 4 -k -iA "$@" +nix-env -f $NIXPKGS -Q --max-jobs 4 -k -iA "$@" diff --git a/dotfiles/.config/neomutt/neomuttrc b/dotfiles/.config/neomutt/neomuttrc @@ -17,25 +17,21 @@ set reverse_name=yes set reverse_realname=no alternates ^jb55@jb55.com$ ^will.casarin@steamoji.com$ + +set use_threads=yes + #set sort = threads #set sort_aux = reverse-last-date-received -#set sort = reverse-last-date-received -set sort = last-date-received +set sort = reverse-last-date-received +#set sort = last-date-received virtual-mailboxes \ "INBOX" "notmuch://?query=query:inbox" \ - "nixpkgs-dev" "notmuch://?query=query:nixpkgs" \ - "2day" "notmuch://?query=query:2day" \ - "best" "notmuch://?query=query:best" \ - "bitcoin" "notmuch://?query=query:bitcoin" \ - "flagged" "notmuch://?query=query:flagged" \ - "github" "notmuch://?query=query:github" \ - "lightning" "notmuch://?query=query:lightning" \ - "list" "notmuch://?query=query:list" \ - "nixpkgs" "notmuch://?query=query:nixpkgs" \ - "notmuch" "notmuch://?query=query:notmuch" \ - "today" "notmuch://?query=query:today" \ - "work" "notmuch://?query=query:work" + "damus-prs" "notmuch://?query=query:damusp" \ + "damus-issues" "notmuch://?query=query:damusi" \ + "damus-all-issues" "notmuch://?query=query:damus-all-issues" \ + "damus-all-issues-no-elsat" "notmuch://?query=query:damus-all-issues-no-elsat" \ + "damus-issues-no-elsat" "notmuch://?query=query:damusinoelsat" macro index,pager a "<modify-labels>-unread -inbox<enter> macro index,pager A "<create-alias>" "Create alias" @@ -74,4 +70,3 @@ set collapse_unread=yes set uncollapse_jump=yes source ~/.mail_aliases - diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig @@ -40,6 +40,7 @@ f = fetch -p br = symbolic-ref --short HEAD ca = commit --amend + cp = cherry-pick mlap = push monad HEAD:laptop c = commit cloner = clone --recursive @@ -71,6 +72,7 @@ stat2 = log --stat --pretty=format:'%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%>(12,trunc)%cr %C(auto,green)%aN %C(auto,red)%D %n%n %C(auto,reset)%s%n' st = status tagd = !"git tag --format='%(creatordate:short)%09%(refname:strip=2)' | sort" + authors = !"git log --format='%aN <%aE>' | sort -u" tg = log --date-order --tags --simplify-by-decoration --pretty=format:'%ai %h %d' try = merge --no-commit --no-ff co = checkout @@ -91,6 +93,8 @@ program = /home/jb55/bin/ots-git [magit] hideCampaign = true +[nostr] + relays = wss://relay.damus.io wss://nos.lol wss://nostr.wine [github] user = jb55 [grep] diff --git a/dotfiles/.notmuch-config b/dotfiles/.notmuch-config @@ -0,0 +1,122 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# + +[database] +path=/Users/jb55/mail/personal + +# User configuration +# +# Here is where you can let notmuch know how you would like to be +# addressed. Valid settings are +# +# name Your full name. +# primary_email Your primary email address. +# other_email A list (separated by ';') of other email addresses +# at which you receive email. +# +# Notmuch will use the various email addresses configured here when +# formatting replies. It will avoid including your own addresses in the +# recipient list of replies, and will set the From address based on the +# address to which the original email was addressed. +# + +[user] +name=William Casarin +primary_email=jb55@jb55.com +other_email=jackbox55@gmail.com;will@damus.io + +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# + +[new] +tags=unread;inbox; +ignore= + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# + +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# + +[maildir] +synchronize_flags=true + +# Cryptography related configuration +# +# The following option is supported here: +# +# gpg_path +# binary name or full path to invoke gpg. +# + +[crypto] +gpg_path=/run/current-system/sw/bin/gpg2 + + +[query] +best=tag:best and tag:inbox +bitcoin=tag:core and tag:inbox and subject:bitcoin/bitcoin +flagged=tag:flagged and tag:inbox +github=tag:github and not tag:busy and tag:inbox +inbox=tag:inbox and not tag:filed +lightning=tag:inbox and tag:lightning +list=tag:list and not tag:github and tag:inbox and not tag:busy +notmuch=tag:notmuch and tag:inbox +today=date:today and tag:inbox +work=tag:inbox and tag:work +damusp=(subject:PR or subject:PATCH) and subject:damus and tag:inbox +damusi=subject:Issue and subject:damus-io and tag:inbox +damus-all-issues=subject:Issue and subject:damus-io +damus-all-issues-no-elsat=subject:Issue and subject:damus-io and not from:alltheseas +damusinoelsat=subject:Issue and subject:damus-io and tag:inbox and not from:alltheseas diff --git a/dotfiles/commands b/dotfiles/commands @@ -44,9 +44,17 @@ gpm git mlap echo git mlap h run history fuzz-run-hist jt jump tag fuzz-jump-tag nai notmuch archive inbox fuzz-notmuch-archive-inbox +nep notmuch edit poll echo vim scp://charon//home/jb55/bin/notmuch-poll nam notmuch am fuzz-notmuch-am ng notmuch github patch fuzz-notmuch-gam nat notmuch archive fuzz-notmuch-archive +nm notmuch muchsync echo muchsync charon +m mutt echo neomutt +mp mutt prs echo neomutt -f damus-prs +mi mutt issues echo neomutt -f damus-issues +min mutt issues noelsat echo neomutt -f damus-issues-no-elsat +mai mutt all issues echo neomutt -f damus-all-issues +main mutt all issues noelsat echo neomutt -f damus-all-issues-no-elsat Nc new command echo make-script ni notmuch inbox fuzz-notmuch-inbox nT email today echo f nt query:today