diff --git a/.config/mutt/accounts/1-david.julien@univ-nantes.fr.muttrc b/.config/mutt/accounts/1-david.julien@univ-nantes.fr.muttrc index 42a9810..cc03a40 100644 --- a/.config/mutt/accounts/1-david.julien@univ-nantes.fr.muttrc +++ b/.config/mutt/accounts/1-david.julien@univ-nantes.fr.muttrc @@ -10,7 +10,8 @@ set message_cachedir = "$XDG_CACHE_HOME/mutt/david.julien@univ-nantes.fr/bodies" set mbox_type = Maildir set crypt_autosign = yes -set pgp_sign_as = "0x1DD6B2BA6DD78810" +set pgp_self_encrypt = yes +set pgp_default_key = "0x1DD6B2BA6DD78810" bind index,pager gg noop bind index,pager g noop @@ -23,7 +24,7 @@ set signature="$XDG_CONFIG_HOME/mutt/accounts/nantes.signature" unmacro index o macro index o "mailsync" "run mbsync to sync david.julien@univ-nantes.fr" -mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=thesis" "=admin" "=login" "=teaching" "=teaching/X11I020" "=teaching/X11I040" +mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=thesis" "=admin" "=login" "=publications" "=teaching" "=teaching/X11I020" "=teaching/X11I040" set record = "+Sent" macro index,pager gs "=Sent" "go to sent" macro index,pager Ms ";=Sent" "move mail to sent" @@ -49,6 +50,9 @@ macro index,pager Ca ";=admin" "copy mail to admin" macro index,pager gl "=login" "go to login" macro index,pager Ml ";=login" "move mail to login" macro index,pager Cl ";=login" "copy mail to login" +macro index,pager gp "=publications" "go to publications" +macro index,pager Mp ";=publications" "move mail to publications" +macro index,pager Cp ";=publications" "copy mail to publications" macro index,pager gc2 "=teaching/X11I020" "go to teaching/X11I020" macro index,pager Mc2 ";=teaching/X11I020" "move mail to teaching/X11I020" macro index,pager Cc2 ";=teaching/X11I020" "copy mail to teaching/X11I020" diff --git a/.config/mutt/neomutt.muttrc b/.config/mutt/neomutt.muttrc index 3de16a8..035642b 100644 --- a/.config/mutt/neomutt.muttrc +++ b/.config/mutt/neomutt.muttrc @@ -3,7 +3,7 @@ # More information : https://github.com/LukeSmithxyz/mutt-wizard -set mailcap_path = /home/swytch/.config/mutt/mailcap:$mailcap_path +set mailcap_path = $XDG_CONFIG_HOME/mutt/mailcap:$mailcap_path set mime_type_query_command = "file --mime-type -b %s" set date_format="%d/%m/%y %I:%M%p" set index_format="%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)" diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index 5ee5ec4..e675aee 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -18,11 +18,13 @@ vim.keymap.set("n", "", "w! | !compiler %") vim.keymap.set("n", "u", function() require("packer").sync() end) -- telescope -vim.keymap.set("n", "ff", +vim.keymap.set("n", "tf", function() require("telescope.builtin").find_files() end) -vim.keymap.set("n", "fb", +vim.keymap.set("n", "tb", function() require("telescope.builtin").buffers() end) -vim.keymap.set("n", "fl", +vim.keymap.set("n", "tg", + function() require("telescope.builtin").grep_string() end) +vim.keymap.set("n", "tl", function() require("telescope.builtin").live_grep() end) -- colorscheme diff --git a/.local/bin/mailsync b/.local/bin/mailsync index d43bece..fe4e979 100755 --- a/.local/bin/mailsync +++ b/.local/bin/mailsync @@ -32,25 +32,16 @@ export GPG_TTY=$TTY notify() { notify-send "neomutt" " $2 new mail(s) in \`$1\` account." } -messageinfo() { - notify-send " $from:" "$subject" -} # Check account for new mail. Notify if there is new content. syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" mbsync "$acc" - new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc -path */new/* -type f -newer "${XDG_STATE_HOME:-$HOME/.local/state}/mailsynclastrun" | grep -iv "trash" 2>/dev/null)" + new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc -path */new/* -type f | grep -iv -e "trash" -e "drafts" 2>/dev/null)" newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) if [ "$newcount" -gt "0" ]; then - for file in $new; do - # Extract subject and sender from mail. - from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') - subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') - messageinfo & - done - notify "$acc" "$newcount" & - [ -n "$(pidof dwmblocks)" ] && kill -40 $(pidof dwmblocks) + notify "$acc" "$newcount" & + [ -n "$(pidof dwmblocks)" ] && kill -40 $(pidof dwmblocks) fi } diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox index 2aaee38..fb8df42 100755 --- a/.local/bin/statusbar/sb-mailbox +++ b/.local/bin/statusbar/sb-mailbox @@ -13,7 +13,7 @@ unread="" for acc in $(ls "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/) do - new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc -path */new/* -type f | grep -iv "trash" | wc -l 2>/dev/null)" + new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc -path */new/* -type f | grep -iv -e "trash" -e "drafts" | wc -l 2>/dev/null)" if [ $new -gt 0 ]; then box="" [ -n "$(echo "$acc" | sed -n '/@centrale/p')" ] && box=""