diff options
Diffstat (limited to 'txt')
| -rwxr-xr-x | txt/account_philip.txt | 51 | ||||
| -rwxr-xr-x | txt/display_filter.txt | 53 | ||||
| -rwxr-xr-x | txt/dwm-config.txt | 139 | ||||
| -rwxr-xr-x | txt/get-mailboxes.txt | 17 | ||||
| -rwxr-xr-x | txt/key.txt | 41 | ||||
| -rwxr-xr-x | txt/mailcap.txt | 11 | ||||
| -rwxr-xr-x | txt/mutt-trim.txt | 171 | ||||
| -rwxr-xr-x | txt/neomuttrc.txt | 173 | ||||
| -rwxr-xr-x | txt/poems.txt | 70 | ||||
| -rwxr-xr-x | txt/print_unicode.txt | 37 | ||||
| -rwxr-xr-x | txt/translate.txt | 14 | ||||
| -rwxr-xr-x | txt/update-fingerprint | 14 | ||||
| -rwxr-xr-x | txt/venelles.txt | 77 |
13 files changed, 868 insertions, 0 deletions
diff --git a/txt/account_philip.txt b/txt/account_philip.txt new file mode 100755 index 0000000..d87ae0c --- /dev/null +++ b/txt/account_philip.txt @@ -0,0 +1,51 @@ +# @File Name : philip.rc + +# base +set realname = "Philip Wittamore" +set from = "philip@wittamore.fr" +set use_from = "yes" +set envelope_from = "yes" + +# +set sendmail = "/usr/bin/msmtp -a philip" +set mbox_type = Maildir + +# folders +set folder=~/.mail/philip/ +set spoolfile = "+Inbox" +set trash = "+Trash" +set postponed = "+Drafts" +set record = "+Sent" + +# dsn +set dsn_notify = "failure,delay" +set dsn_return = hdrs + +# sidebar +unmailboxes * +mailboxes `~/Apps/Neomutt/bin/get-mailboxes.sh ~/.mail/philip` + +# GPG +#set crypt_use_gpgme=yes +#set crypt_reply_sign=yes +#set crypt_reply_encrypt=yes +#set crypt_reply_sign_encrypted=yes +#set crypt_autosign=yes +#set crypt_verify_sig=yes + +#set pgp_default_key="9FD4104BF8734069C65C9E7062C85864C0420C9A" +#set pgp_autosign=yes +#set pgp_replyencrypt=yes +#set pgp_replysign=yes +#set pgp_timeout=1800 + +# signature +set sig_on_top = yes +set sig_dashes = yes +set signature = "iconv -f utf-8 ~/Apps/Neomutt/accounts/philip.sig.rc|" + +# +subscribe neomutt-users + +# macros +macro index <F6> "<shell-escape>mbsync philip<enter>" diff --git a/txt/display_filter.txt b/txt/display_filter.txt new file mode 100755 index 0000000..e45bf02 --- /dev/null +++ b/txt/display_filter.txt @@ -0,0 +1,53 @@ +#!/bin/bash +# lun. 29 mars 2021 09:05:05 CEST +# Neomutt display_filter.sh +# filter for pager display only + +sed -e ' + +# clean up neomutt notifications +/\[-- Visualisation.* --\]/d +/\[-- Type: text.* --\]/d +/\[-- Type.* --\]/d +/\[-- Pièce jointe #[0-9] --\]/d +s/Pièce jointe #[0-9]: //g +/\[-- .* pas disponible .* --\]/d + +# url tidy +# put each url on a new line +s/http/\nhttp/g +# replace last /blahblah with /... +#s|\(http.*\)/.*|\1\/...| + +# hide messy inline pdf +/^%PDF-1.4/,/^%%EOF/d + +# add newline after --] +s/--\]/--\]\n/g + +# CID +s/\[cid/\n\[cid/g + +# delete [img] tags +s/\[img\]//g + +# change ugly lines +s/━/-/g + +# remove last < +s/<*$// + +# remove lone [ +s/^\[$// + +# delete single spaces at the beginning of lines +s/^ //g + +# delete multiple spaces +s/[[:space:]]\+/ /g + +# delete multiple blank lines + +' | awk '!NF {if (++n <= 1) print; next}; {n=0;print}' + + diff --git a/txt/dwm-config.txt b/txt/dwm-config.txt new file mode 100755 index 0000000..6d4e678 --- /dev/null +++ b/txt/dwm-config.txt @@ -0,0 +1,139 @@ +/* See LICENSE file for copyright and license details. */ +#include <X11/XF86keysym.h> + +/* appearance */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ +static const char *fonts[] = { "JetBrainsMono Nerd Font Mono:size=11" }; +static const char dmenufont[] = "JetBrainsMono Nerd Font Mono"; +static const char col_gray1[] = "#222222"; +static const char col_gray2[] = "#444444"; +static const char col_gray3[] = "#bbbbbb"; +static const char col_gray4[] = "#eeeeee"; +static const char col_rust[] = "#C74C00"; +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_rust }, + [SchemeSel] = { col_gray4, col_rust, col_rust }, +}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4"}; //, "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ + /* class instance title tags mask isfloating monitor */ + { "ghostty", NULL, NULL, 1 << 0, 0, -1 }, + { "librewolf", NULL, NULL, 1 << 1, 0, -1 }, + { "Chromium", NULL, NULL, 1 << 1, 0, -1 }, + { "Gimp", NULL, NULL, 1 << 2, 1, -1 }, + { "gThumb", NULL, NULL, 1 << 2, 1, -1 }, + { "galculator", NULL, NULL, 1 << 8, 1, -1 }, + { "Orage" , NULL, NULL, 1 << 8, 1, -1 }, +}; + +/* layout(s) */ +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ + +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* key definitions */ +#define MODKEY Mod4Mask +#define TAGKEYS(KEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + +/* commands */ +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_rust, "-sf", col_gray4, NULL }; +static const char *termcmd[] = { "ghostty", NULL }; +static const char *wwwcmd[] = { "librewolf", NULL }; +static const char *brighter[] = { "brightnessctl", "set", "10%+", NULL }; +static const char *dimmer[] = { "brightnessctl", "set", "10%-", NULL }; +static const char *bluetooth[] = { "blueman-manager", NULL }; +static const char *scrotcmd[] = { "screenshot.sh", NULL}; + +static const Key keys[] = { + /* modifier key function argument */ + { 0, XF86XK_AudioMute, spawn, SHCMD("~/.local/bin/dwm-audio voltoggle") }, + { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("~/.local/bin/dwm-audio volquieter") }, + { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("~/.local/bin/dwm-audio vollouder") }, + { 0, XF86XK_AudioMicMute, spawn, SHCMD("~/.local/bin/dwm-audio mictoggle") }, + { 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } }, + { 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } }, + { 0, XK_Print, spawn, {.v = scrotcmd } }, + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_w, spawn, {.v = wwwcmd } }, + { MODKEY, XK_r, spawn, SHCMD("rofi -show run") }, + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_Right, focusstack, {.i = +1 } }, + { MODKEY, XK_Left, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, + { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_space, setlayout, {0} }, + { MODKEY, XK_agrave, view, {.ui = ~0 } }, + { MODKEY, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY|ShiftMask, XK_agrave, tag, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_semicolon, tagmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, + { MODKEY|ShiftMask, XK_q, quit, {0} }, + { MODKEY|ShiftMask, XK_x, spawn, SHCMD("rofi -show power-menu -modi power-menu:rofi-power-menu") }, + { MODKEY|ShiftMask, XK_b, spawn, {.v = bluetooth } }, + TAGKEYS( XK_ampersand, 0) + TAGKEYS( XK_eacute, 1) + TAGKEYS( XK_quotedbl, 2) + TAGKEYS( XK_apostrophe, 3) + TAGKEYS( XK_parenleft, 4) + TAGKEYS( XK_minus, 5) + TAGKEYS( XK_egrave, 6) + TAGKEYS( XK_underscore, 7) + TAGKEYS( XK_ccedilla, 8) + TAGKEYS( XK_agrave, 9) +}; + +/* button definitions */ +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +static const Button buttons[] = { + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, +}; + diff --git a/txt/get-mailboxes.txt b/txt/get-mailboxes.txt new file mode 100755 index 0000000..b6ceff0 --- /dev/null +++ b/txt/get-mailboxes.txt @@ -0,0 +1,17 @@ +#!/bin/sh + +maildir=$1 + +# Find these specific paths so they stick at the top of the list +MAILBOXES='"+Inbox" "+Sent" "+Trash" "+Drafts" "+Junk" ' + +#Find all other paths, excluding those from above +MAILBOXES=$MAILBOXES`find "${maildir}" -type d -name cur \ + -a -not \( -ipath "*Inbox*" \ + -o -ipath "*Sent*" \ + -o -ipath "*Drafts*" \ + -o -ipath "*Trash*" \ + -o -ipath "*Junk*" \ + \) | sed -e 's/\/cur$/\"/g' -e "s#^${maildir}/# \"+#" | sort` + +echo $MAILBOXES
\ No newline at end of file diff --git a/txt/key.txt b/txt/key.txt new file mode 100755 index 0000000..5e4e6fe --- /dev/null +++ b/txt/key.txt @@ -0,0 +1,41 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=cE2x +-----END PGP PUBLIC KEY BLOCK----- diff --git a/txt/mailcap.txt b/txt/mailcap.txt new file mode 100755 index 0000000..189e257 --- /dev/null +++ b/txt/mailcap.txt @@ -0,0 +1,11 @@ +# +text/html; librewolf %s; +text/html; cha -T text/html %s;copiousoutput; +# +audio/*; cp %s ~/Apps/Neomutt/tmp \; vlc ~/Apps/Neomutt/tmp/$(basename %s) > /dev/null 2>&1 & +image/*; cp %s ~/Apps/Neomutt/tmp \; ristretto ~/Apps/Neomutt/tmp/$(basename %s) > /dev/null 2>&1 & +# +application/ics; /usr/bin/calcurse -i %s && notify-send "Entry added to calendar 📅" +text/calendar; /usr/bin/calcurse -i %s && notify-send "Entry added to calendar 📅" +text/x-vcard; ~/Apps/Neomutt/bin/mutt.vcard.filter; copiousoutput; +application/*; cp %s ~/Apps/Neomutt/tmp \; xdg-open ~/Apps/Neomutt/tmp/$(basename %s) > /dev/null 2>&1 & diff --git a/txt/mutt-trim.txt b/txt/mutt-trim.txt new file mode 100755 index 0000000..2378ea6 --- /dev/null +++ b/txt/mutt-trim.txt @@ -0,0 +1,171 @@ +#!/usr/bin/perl +# +# "Beautify" quoted message and make it "ready-to-reply". Originally by Michael Velten. + +use utf8; + +# keep quotes nested up to 3rd level +my $ind_max = 3; +# # put 1 empty line between first and following quote +# my $gap = 1; + +my $name = '[[:alpha:]]+([\'`-][[:alpha:]]+|[.])*'; +my $fullname = '\b(' . $name . '[,]?\s+)*' . $name . '\b'; + +# Possible reply greetings (regexes) (note that '> ' will be prefixed) +my @greetings = ( + 'Dear\s+' . $fullname . '([,.]|\s*!)?', + '[Hh](ello|i|ey)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Sehr geehrter?\s+' . $fullname . '([,.]|\s*!)?', + 'Lieber?\s+' . $fullname . '([,.]|\s*!)?', + 'Guten Tag' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Hh]allo' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Mm]oin' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Mm]esdames(,| et) [Mm]essieurs([,.]|\s*!)?', + 'M(adame)\s+' . $fullname . '([,.]|\s*!)?', + 'M(onsieur)\s+' . $fullname . '([,.]|\s*!)?', + '[Cc]her\s+' . $fullname . '([,.]|\s*!)?', + '[Cc]hère\s+' . $fullname . '([,.]|\s*!)?', + '[Bb]onjour' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Ss]alut' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Senhor(ita|a)?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Sra?\.?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Car(íssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Prezad(íssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Estimad(íssim)?[ao]s?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Bb]om [Dd]ia' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Bb]oa ([Tt]arde|[Nn]oite)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Oo](i|lá|la)' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Aa]l[ôo]' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + '[Hh]ola' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + 'Se[ñ]or(ita|a)?' . '(\s+' . $fullname . ')?' . '([,.]|\s*!)?', + ); + +# Possible reply "greetouts" (regexes) (note that '> ' will be prefixed) +my @greetouts = ( + '([Ww]ith )?(([Kk]ind|[Bb]est|[Ww]arm) )?([Rr]egards|[Ww]ishes)([,.]|\s*!)?', + '[Bb]est([,.]|\s*!)?', + '[Cc]heers([,.]|\s*!)?', + '[Mm]it ([Vv]iel|[Bb]est|[Ll]ieb|[Ff]reundlich)en [Gg]r([ü]|ue)([ß]|ss)en([,.]|\s*!)?', + '(([Vv]iel|[Bb]est|[Ll]ieb|[Ff]reundlich)e )?[Gg]r([ü]|ue)([ß]|ss)e([,.]|\s*!)?', + '(([[Bb]est|[Ll]ieb|[Ff]reundlich)e[rn] )?[Gg]ru([ß]|ss)([,.]|\s*!)?', + '[Mm]it (([[Bb]est|[Ll]ieb|[Ff]reundlich)em )?[Gg]ru([ß]|ss)([,.]|\s*!)?', + '([LV]|MF)G([,.]|\s*!)?', + '(([Tt]rès|[Bb]ien) )?([Cc]ordi|[Aa]mic)alement([,.]|\s*!)?', + '[Aa]miti[é]s?([,.]|\s*!)?', + '[Aa]tenciosamente([,.]|\s*!)?', + '[Aa]tt([,.]|\s*!)?', + '[Aa]abraços?([,.]|\s*!)?', + '[Aa]tentamente([,.]|\s*!)?', + '[Cc]ordialmente([,.]|\s*!)?', + ); + +my $word = '[[:alpha:]]+([\'`-][[:alpha:]]+)*'; + +# my $saw_greeting = 0; +# my $saw_leadin = 0; +# my $saw_greetout = 0; +my $saw_own_sig = 0; +my $saw_blank_line = 0; +my $inds_other_sig = 0; +my $quote_header = 0; +my $extra_pref = ''; +# my $prev_inds = 0; + +my (@mail, @purged_mail); + +my $msg = shift; +die "Usage: $0 MAIL" unless $msg; +open(MAIL, "+<:encoding(UTF-8)", $msg) or die "$0: Can't open $msg: $!"; +push(@mail, $_) while <MAIL>; # Read whole mail + +# Process whole mail +LINE: +foreach my $line (@mail) { + +# Treat non-quoted lines as is + if ($line !~ /^>/) { + push(@purged_mail, $line); + next LINE; + } + +# Keep all lines after my own signature unmodified + if ($line =~ /^--\s?$/ || $saw_own_sig) { + $saw_own_sig = 1; + push(@purged_mail, $line); + next LINE; + } + + # $line =~ tr/\xA0/ /; +# tighten "> > " to ">> " + my ($pref, $suff) = $line =~ /^([>[:space:]]+)(.*)$/; + $pref =~ s/(>\s*(?!$))/>/g; +# reduce multiple pre- and post-blanks to one post-blank + $pref =~ s/^\s*(>+)\s*/$1 /; + $line = $pref . $suff . "\n"; + +# prepend additional '>' for each Outlook quote header + if ($line =~ /^>+ [-_=]{3,}\s*$word(\s+$word)*\s*[-_=]{3,}$/) { + $quote_header = 1; + next LINE; + } +# first line after Outlook quote header that does not start with ...: + if ($quote_header == 1 && $line !~ /^>+ ([-*]\s*)?$word(\s+$word)*\s*:\s+/) { + $extra_pref = '>' . $extra_pref; + $quote_header = 0; + } + $pref = $extra_pref . $pref; + $line = $pref . $suff . "\n"; + +# skip line if number of '>'s is greater than $ind_max + my $inds = $pref =~ tr/>//; + next LINE if $inds > $ind_max; + +# Remove other signatures + if ($line =~ /^>+ --\s?$/) { + $inds_other_sig = $inds; + } + if ($inds == $inds_other_sig) { + next LINE; + } else { + $inds_other_sig = 0; + } + +# Remove quoted greeting + # unless ($saw_greeting) { + foreach my $greeting (@greetings) { + if ($line =~ /^>+ $greeting$/) { + # $saw_greeting = 1; + next LINE; + } + } + # } + +# Remove quoted "greetout" + # unless ($saw_greetout) { + foreach my $greetout (@greetouts) { + if ($line =~ /^>+ $greetout$/) { + # $saw_greetout = 1; + next LINE; + } + } + # } + +# Remove quoted filler lines + if ($line =~ /^>+ \s*(-*|_*|=*|\+*|#*|\**)$/) { + next LINE; + } + +# Insert $gap empty lines between different quote levels + # $line = "\n" x $gap . $line if $prev_inds < $inds; + # $prev_inds = $inds; + +# Save purged line + push(@purged_mail, $line); +} + +# Overwrite original mail with purged mail +truncate(MAIL, 0); +seek(MAIL, 0, 0); +print MAIL @purged_mail; +close(MAIL); diff --git a/txt/neomuttrc.txt b/txt/neomuttrc.txt new file mode 100755 index 0000000..423c555 --- /dev/null +++ b/txt/neomuttrc.txt @@ -0,0 +1,173 @@ +# .neomuttrc + +set config_charset = "utf-8" +set send_charset = "utf-8" +set charset = "utf-8" +set assumed_charset = "utf-8" +set attach_charset = "utf-8" +set rfc2047_parameters = yes + +set header_cache = ~/Apps/Neomutt/cache/headers +set certificate_file = ~/Apps/Neomutt/certificates +set message_cachedir = ~/Apps/Neomutt/cache/bodies +set alias_file = ~/Apps/Neomutt/aliases +set mailcap_path = ~/Apps/Neomutt/mailcap +set tmpdir = /tmp + +# mail settings +set mail_check = 30 +set timeout = 600 # time to wait until abort waiting for input. +set mail_check_stats # periodically calculate message statistics +set xterm_set_titles = yes +set sleep_time = 0 # Don't pause + +# mailcap +auto_view text/html text/plain + +# Sidebar +set sidebar_visible = yes +set sidebar_short_path # Shorten mailbox names +set sidebar_delim_chars = "/." # Delete everything up to the last / character +set sidebar_folder_indent = yes # Indent folders whose names we've shortened +set sidebar_indent_string = "▸" +set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S" +set sidebar_width = 30 +set sidebar_sort_method = "unsorted" +set sidebar_divider_char ="│" + +# Folder hooks +folder-hook . `rm -f /Apps/Neomutt/tmp/*` # empty tmp folder +folder-hook "~/.mail/philip/*" "source ~/Apps/Neomutt/accounts/philip.rc" + +# Printing +set print = ask-no +set print_command = "~/Apps/Neomutt/bin/print_unicode.sh" + +# index display +set sort = threads +set sort_aux = last-date-received +set delete = yes # just delete don't ask + +# pager display +set pager = "builtin" +set smart_wrap = yes # lines wrapped at word boundary at screen edge. +set markers = no # don't add "+" at wrapped lines +set pager_stop = yes # don't continue to next message +set display_filter = "~/Apps/Neomutt/bin/display_filter.sh" + +# message display +ignore * +unhdr_order * +unignore Date: From: To: Cc: Bcc: X-Mailer: User-Agent: X-Spam-Flag: Subject: +hdr_order Date: From: To: Cc: Bcc: X-Mailer: User-Agent: X-Spam-Flag: Subject: +set quote_regex = "^([ \t]*[|>:}#])+" +set smileys = "(>From )|(:[-^]?[][)(><}{|/DP])" # catch some common false positives of $quote_regex +set pipe_decode = "yes" # weed headers and attempt to decode the messages first. + +# attachments +attachments +A */.* # Give all MIME parts an "attachment" disposition +set attach_save_dir = "~/Documents" +set attach_save_without_prompting +set abort_noattach = ask-yes +# French & English regex +set abort_noattach_regex = "\\<(attach|attached|attaché|attachés|attache|attachons|joint|jointe|joints|jointes|joins|joignons)\\>" + +# editor +set text_flowed = yes # don't cut lines +#set editor = "~/.neomutt/bin/mutt-trim %s; joe -nobackups %s" +set editor = "~/Apps/Neomutt/bin/mutt-trim %s; micro %s" + +# Replies +set attribution = "* %n <%a> [%(%y%m%d %H:%M)]:" +set fast_reply # do not ask for to, subject,... when replying. +set include = yes # include message + +# Forwards +set forward_format = "[Tr: %s]" +set forward_quote + +# Abook +set query_command = "abook --mutt-query '%s'" +macro index,pager a "<pipe-message>abook --add-email-quiet<return>" "Add this sender to Abook" +macro generic,index,pager \ca "<shell-escape>abook<return>" "launch abook" + +# Header Compression +set header_cache_compress_method = "zlib" +set header_cache_compress_level = 1 + +# PGP commands +set pgp_decode_command = "gpg2 %?p?--passphrase- 0? --no-verbose --batch --output - %f" +set pgp_verify_command = "gpg2 --no-verbose --batch --output - --verify %s %f" +set pgp_decrypt_command = "gpg2 --passphrase- 0 --no-verbose --batch --output - %f" +set pgp_sign_command = "gpg2 --no-verbose --batch --output - --passphrase- 0 --armor --detach-sign --textmode %?a?-u %a? %f" +set pgp_clearsign_command = "gpg2 --no-verbose --batch --output - --passphrase- 0 --armor --textmode --clearsign %?a?-u %a? %f" +set pgp_encrypt_only_command = "/usr/lib/neomutt/pgpewrap gpg2 --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f" +set pgp_encrypt_sign_command = "/usr/lib/neomutt/pgpewrap gpg2 --passphrase- 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to $pgp_sign_as -- -r %r -- %f" +set pgp_import_command = "gpg2 --no-verbose --import %f" +set pgp_export_command = "gpg2 --no-verbose --export --armor %r" +set pgp_verify_key_command = "gpg2 --no-verbose --batch --fingerprint --check-sigs %r" +set pgp_list_pubring_command = "gpg2 --no-verbose --batch --with-colons --list-keys %r" +set pgp_list_secring_command = "gpg2 --no-verbose --batch --with-colons --list-secret-keys %r" + + +# other settings + +#unset quit +# macro index,pager ",m" ":unset wait_key\n |/path/to/add_to_calcurse.sh<enter><exit>" +# set pager_index_lines = 6 # number of lines of a mini-index when in pager + +# Spam flag +# spam "X-Spam-Flag: YES" "" +# This pushes spam lines to right and it's ugly +# so instead I colour the line that contains X-Spam-Flag using +# color index color197 color233 ~hX-Spam-Flag +# in the colour theme + +# add my_hdr $mutt_version - $os_version +my_hdr User-Agent: `neomutt -v | head -1` - `uname -r` Linux + +# file browser +set sort_browser=reverse-date + +#### Key bindings +# sidebar +bind index,pager <C-up> sidebar-prev # Previous Mailbox +bind index,pager <C-down> sidebar-next # Next Mailbox +bind index,pager * sidebar-open # Open Highlighted Mailbox +# +bind pager <down> next-line # pager down one line +bind pager <up> previous-line # pager up one line +bind editor <Tab> complete-query # Abook completion + +#### Macros +# account swap +unset wait_key #don't wait for user input +macro index,pager <F2> "<sync-mailbox><enter-command>source ~/Apps/Neomutt/accounts/philip.rc<enter><change-folder>!<enter><redraw-screen>" +# toggle sidebar +macro index,pager <F5> "<enter-command>toggle sidebar_visible <enter><redraw-screen>" +# F6 in index runs mbsync, see philip.rc +macro pager <F6> "<pipe-message>~/Apps/Neomutt/bin/translate.sh<enter>" +# urlscan +macro index,pager \cb "<pipe-message>urlscan -c -d<Enter>" "call urlscan to extract URLs out of a message" +macro attach,compose \cb "<pipe-entry>urlscan -c -d<Enter>" "call urlscan to extract URLs out of a message" +# reload config +macro index,browser,pager \cr "<enter-command>source ~/Apps/Neomutt/.neomuttrc<enter>" +# View in graphic browser +macro attach 'V' "<pipe-entry>iconv -c --to-code=UTF8 > ~/Apps/Neomutt/tmp/mail.html<enter><shell-escape>floorp ~/.neomutt/tmp/mail.html<enter>" + +# SPAM +# Mark as not spam and move mail to inbox +macro index,pager n "<tag-prefix><pipe-entry>bogofilter -Mn<enter>\ +<tag-prefix><save-message>=Inbox<enter><enter><sync-mailbox>" "Mark as non spam & move to Inbox" +# Mark as not spam and do nothing else +macro index . "<tag-prefix><pipe-entry>bogofilter -Mn<enter>" "Mark as not spam in index" +macro pager . "<pipe-entry>bogofilter -Mn<enter>" "Mark as not spam in pager" +# Mark as spam and delete +macro index x "<tag-prefix><pipe-entry>bogofilter -MNs<enter><tag-prefix><save-message>=Junk<enter><enter><sync-mailbox>" +macro pager x "<pipe-entry>bogofilter -MNs<enter><save-message>=Junk<enter><enter><sync-mailbox>" + + +#### more config files +source ~/Apps/Neomutt/accounts/philip.rc # default account +source ~/Apps/Neomutt/themes/powerline.rc # powerline with nerd fonts +source ~/Apps/Neomutt/themes/venelles.rc # my color theme diff --git a/txt/poems.txt b/txt/poems.txt new file mode 100755 index 0000000..c6879e5 --- /dev/null +++ b/txt/poems.txt @@ -0,0 +1,70 @@ +--- +Joy of the grind +--- +Life is but a long farewell +Clawing at eternity's shell +A hopeless fight face entropy's might +This fleeting hare brings grave dispair +But pointless is our daily dread +Of closing circuit in our bed +So keep the pennies on the shelf +Existance is the prize itself + +--- +Emperors summer +--- +Of what ego did Augustus suffer +To name the month of dermic blusher +Did Julius reap the wheat himself +To name month fore weodmonath +Did butterflies of light divine +Flutter through their regal shine +Or was it summer's extasy +That lent this insight pleasantly +Make down the ages people utter +Their names while bathing golden butter + +--- +The universe observing +--- +The redshift of dim distant light +A foetus of the first bomb site +The universe's shock debut +Cast baryons, then me and you +Our evoluted thought process +Shaped science and our mind's egress +Man looked upon the pale redshift +And thus the cosmic mirror gift +Of universe's constant oeuvre +Enabling it to self observe + + +--- +A pointless myth +--- +I don't have the propensity +To appreciate god's density +To me the ecsis of humanity +Has no need of an almighty +Beliefs don't fly, they're all at sea +Comfort for some, a spirits decree +Cannot escape the reality +That life that's born of chemistry +Can assemble someone just like me + + +--- +Slices of a giant +--- +Mangled by biting teeth of iron +A giant falls impotent, still +The forest witnessed its lost scion +Dragged through ferns its lignin shell +Hefted, chained to diesel barrow +Sectioned and reduced by mill +No longer heard the song of sparrow +Shaped and nailed to form man's will + +--- + + diff --git a/txt/print_unicode.txt b/txt/print_unicode.txt new file mode 100755 index 0000000..24815a0 --- /dev/null +++ b/txt/print_unicode.txt @@ -0,0 +1,37 @@ +#!/bin/bash + +## print_unicode.sh +## By Amanda Hickman https://gist.github.com/amandabee/cf7faad0a6f2afc485ee +## Using https://github.com/baruchel/txt2pdf to print emails to PDF with unicode support. + +pdir="$HOME/.neomutt/tmp" +open_pdf=qpdfview +scriptloc="python3 $HOME/.neomutt/bin/text2pdf.py" + +# check to make sure that we're looking for txt2pdf in the right place +if ! command -v python3 $scriptloc >/dev/null; then + echo "Is $scriptloc installed?" + exit 1 +fi + +# create temp dir if it does not exist +if [ ! -d "$pdir" ]; then + mkdir -p "$pdir" 2>/dev/null + if [ $? -ne 0 ]; then + echo "Unable to make directory '$pdir'" 1>&2 + exit 2 + fi +fi + +# dump stdin to a tempfile +tmptxt="`mktemp $pdir/mutt_XXXXXXX.txt`" +cat >> $tmptxt + +tmpfile="`mktemp $pdir/mutt_XXXXXXXX.pdf`" + +# Actually write the text into a PDF. +$scriptloc --quiet -o $tmpfile $tmptxt +$open_pdf $tmpfile >/dev/null 2>&1 & +sleep 1 +rm $tmpfile +rm $tmptxt diff --git a/txt/translate.txt b/txt/translate.txt new file mode 100755 index 0000000..b19adcb --- /dev/null +++ b/txt/translate.txt @@ -0,0 +1,14 @@ +#!/bin/bash +# last-modified: 2021-03-20 20:38:27+01:00 +# requires https://github.com/soimort/translate-shell +# Arch Linux: yay -S translate-shell + +clear + +INPUT="$1" +cat $INPUT | sed -e '1,/^\r\{0,1\}$/d' | sed '/^>/d' > ~/Apps/Neomutt/tmp/tr.txt + +trans :en -no-browser file:///home/philip/Apps/Neomutt/tmp/tr.txt + +exit 0 + diff --git a/txt/update-fingerprint b/txt/update-fingerprint new file mode 100755 index 0000000..a151d2c --- /dev/null +++ b/txt/update-fingerprint @@ -0,0 +1,14 @@ +#!/bin/bash + +# update tls_fingerprint entry in ~/.msmtprc + +cd /home/philip + +# get the server fingerprint +KEY=$(msmtp --serverinfo --tls --tls-certcheck=off --host=mail.nagatha.fr --port=587 | grep SHA256:) +# remove spaces +KEY=$(echo $KEY | tr -d ' ') +# remove SHA256: +KEY=${KEY:7} +# replace tls_fingerprint line in .msmtprc +sed -i "s/^tls_fingerprint.*/tls_fingerprint $KEY/g" .msmtprc diff --git a/txt/venelles.txt b/txt/venelles.txt new file mode 100755 index 0000000..ea8eb12 --- /dev/null +++ b/txt/venelles.txt @@ -0,0 +1,77 @@ +# venelles.rc + +# general +color error color231 color212 +color indicator color0 color228 +color markers color210 color233 +color message color254 color233 +color normal color254 color233 +color prompt color254 color233 +color search color84 color233 +color status color249 color236 +color tilde color231 color233 +color tree color94 color233 +color quoted color71 color233 # all quoted lines +color signature color212 color233 +color progress white red + +# message index +color index color159 color233 ~A # all messages +color index color35 color233 ~P # from me +color index color46 color233 ~N # new message line +color index_flags color22 color233 ~Q # replied to line +color index color178 color233 ~F # flagged message line +color index_flags color196 color233 ~F # flag colour +color index color160 color233 ~D # deleted message line +color index color215 color233 ~T # tagged message line +color index color197 color233 ~hX-Spam-Flag #spam + +# sidebar +color sidebar_divider color192 color233 # The dividing line between the Sidebar and the Index/Pager panels +color sidebar_flagged color174 color233 # Mailboxes containing flagged mail +color sidebar_highlight color233 color101 # Cursor to select a mailbox +color sidebar_indicator color233 color228 # The mailbox open in the Index panel +color sidebar_new color46 color233 # Mailboxes containing new mail +color sidebar_ordinary color192 color233 # Mailboxes that have no new/flagged mails, etc. +color sidebar_spool_file color192 color233 # Mailbox that receives incoming mail +color sidebar_unread color192 color233 # Mailboxes containing unread mail + + +# message headers +color hdrdefault color233 color30 +color header color231 color30 ^Subject:.* +color header white red ^X-Spam-Flag:.* + +# message body +color attachment color222 color233 +color body color9 color233 [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses + +color body color231 color233 (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text +color body color231 color233 (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text +color body color231 color233 (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text +color body color124 color233 Sent.from.* +color body color233 color155 "[;:]-*[)>(<|]" +color body color196 color233 "[*] .*:$" # Attribution (gukes) +color body color196 color233 "Le .* a écrit :$" # Attribution (French) +color body color196 color233 "On .* wrote:$" +color body color39 color233 "\\[[0-9]+\\]" +color body color143 color233 "^#v[-+]" +color body color39 color233 (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs +color body color235 color233 "\\[.*\\]" +color body color39 color233 "\\[-- .* --\\]" + +# The older the email, the darker it appears. +color index color250 default "~d >7d" # older than 7 days +color index color245 default "~d >20d" # older than 20 days +color index color240 default "~d >30d" # older than 30 days +color index color238 default "~d >90d" # older than 90 days + +# PGP111 +color body color215 color233 "^Bonne signature de : .*" +color body color215 color233 "créée : .*" +color body color215 color233 "aka : .*" +color body color215 color233 "^ATTENTION ! Nous n'avons AUCUNE indication .*" +color body color215 color233 "^Empreinte : .*" +color body color196 color233 "^Signature problématique de : .*" + + |
