From 34720237496914cf30a47d753f19b07989c5d4b5 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Wed, 2 Nov 2022 10:41:19 +0100 Subject: [PATCH 01/11] [dunst] fix: change default font to FiraCode --- .config/dunst/dunstrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index aad0cc1..a957d26 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -105,7 +105,7 @@ ### Text ### - font = Iosevka Fixed Slab 14 + font = FiraCode 12 # The spacing between lines. If the height is smaller than the # font height, it will get raised to the font height. From 7b912a8aa93a41ccb4dd10b24448927934c25318 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Wed, 2 Nov 2022 10:42:08 +0100 Subject: [PATCH 02/11] [mail] fix: colors in light colorscheme --- .config/neomutt/colors | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.config/neomutt/colors b/.config/neomutt/colors index 9b13b9d..ffc6b81 100644 --- a/.config/neomutt/colors +++ b/.config/neomutt/colors @@ -7,9 +7,9 @@ color index_number blue default color index_subject cyan default '.*' # New mail is boldened: -color index brightyellow black "~N" -color index_author brightred black "~N" -color index_subject brightcyan black "~N" +color index brightyellow default "~N" +color index_author brightred default "~N" +color index_subject brightblue default "~N" # Tagged mail is highlighted: color index brightyellow blue "~T" @@ -24,9 +24,9 @@ mono error bold color normal default default color indicator brightblack white color sidebar_highlight red default -color sidebar_divider brightblack black -color sidebar_flagged red black -color sidebar_new green black +color sidebar_divider brightblack default +color sidebar_flagged red default +color sidebar_new green default color normal brightyellow default color error red default color tilde black default @@ -34,7 +34,7 @@ color message cyan default color markers red white color attachment white default color search brightmagenta default -color status brightyellow black +color status brightyellow default color hdrdefault brightgreen default color quoted green default color quoted1 blue default From 3284e727b7a2a076d55047408d07a45d5fe2931c Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 3 Nov 2022 10:28:43 +0100 Subject: [PATCH 03/11] [status] fix: trailing spaces in sb-internet --- .local/bin/statusbar/sb-internet | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index cc97934..9be2376 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -10,7 +10,7 @@ ###################################################################### -# Wifi quality percentage and  icon if ethernet is connected. +# Wifi ssid and  icon if ethernet is connected. ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')" state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')" case "$state" in @@ -20,9 +20,9 @@ case "$state" in esac eth="$(cat /sys/class/net/enp0s31f6/operstate)" if [ "up" = "$eth" ]; then - str="$(printf "%s /  " "$str")" + str="$(printf "%s / " "$str")" fi vpn="$(pidof openvpn)" -[ -n "$vpn" ] && str="$(printf "%s  " "$str")" +[ -n "$vpn" ] && str="$(printf "%s " "$str")" printf " %s " "$str" From 68c375abdcce7fdf37dc82fba9949dfaf9903035 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 3 Nov 2022 15:01:32 +0100 Subject: [PATCH 04/11] [sxhkd] feat: use XF86 keys by default for volume --- .config/sxhkd/sxhkdrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 7aa4bed..6082152 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -2,9 +2,10 @@ # System stuff -super + F1 +XF86AudioMute pulsemixer --toggle-mute; audio-notify -super + {F2, F3} + +{XF86AudioLowerVolume, XF86AudioRaiseVolume} pulsemixer --change-volume {-5, +5}; audio-notify super + {F5, F6} From 81b5358a211ce4dd3487810927b4a6756c7c4e1b Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 3 Nov 2022 15:04:37 +0100 Subject: [PATCH 05/11] [mail] fix: $NOTMUCH_CONFIG has a more generic name --- .config/zsh/.zprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 1dd6945..e4e030c 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -14,7 +14,7 @@ export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" export LESSHISTFILE="-" export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config" -export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/notmuchrc" +export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config" export NMBGIT="$XDG_DATA_HOME/notmuch/nmbug" export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME/android" export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" From 342d4973a30d48c38756bb03406cd75690ec10d8 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 3 Nov 2022 18:11:00 +0100 Subject: [PATCH 06/11] [mail] feat: add forge subfolder to univ-nantes --- .../neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc b/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc index 2970bb4..8f24f9d 100644 --- a/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc +++ b/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc @@ -24,7 +24,7 @@ set signature="$XDG_CONFIG_HOME/neomutt/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" "=publications" "=teaching" "=teaching/X11I020" "=teaching/X11I040" +mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=thesis" "=publications" "=teaching" "=teaching/X11I020" "=teaching/X11I040" "=forge" "=admin" "=login" set record = "+Sent" macro index,pager gs "=Sent" "go to sent" macro index,pager Ms ";=Sent" "move mail to sent" @@ -44,6 +44,9 @@ set spoolfile = "+INBOX" macro index,pager gT "=thesis" "go to thesis" macro index,pager MT ";=thesis" "move mail to thesis" macro index,pager CT ";=thesis" "copy mail to thesis" +macro index,pager gf "=forge" "go to forge" +macro index,pager Mf ";=forge" "move mail to forge" +macro index,pager Cf ";=forge" "copy mail to forge" macro index,pager ga "=admin" "go to admin" macro index,pager Ma ";=admin" "move mail to admin" macro index,pager Ca ";=admin" "copy mail to admin" From 541e28595f6c667259a8f9f2a6a47e02a7b016fe Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 4 Nov 2022 10:06:07 +0100 Subject: [PATCH 07/11] [scripts] feat: automatic cursor setup --- .local/bin/cursor_setup | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 .local/bin/cursor_setup diff --git a/.local/bin/cursor_setup b/.local/bin/cursor_setup new file mode 100755 index 0000000..13b5e81 --- /dev/null +++ b/.local/bin/cursor_setup @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +###################################################################### +# @author : swytch (adapted from Luke Smith - lukesmith.xyz) +# @file : cursor_setup +# @license : GPLv3 +# @created : Friday Nov 04, 2022 10:02:12 CET +# +# @description : handles cursor setup in cas `xinput` lists the same +# device several times +###################################################################### + + +if [ "$1" = "" ]; then + exit 1 +fi + +ids=$(xinput --list | awk -v search="$1" \ + '$0 ~ search {match($0, /id=[0-9]+/);\ + if (RSTART) \ + print substr($0, RSTART+3, RLENGTH-3)\ + }'\ + ) + +for i in $ids +do + [ "trackpad" = "$2" ] && xinput set-prop $i 'libinput Tapping Enabled' 1 & + xinput set-prop $i 'libinput Natural Scrolling Enabled' 1 & + xinput set-prop $i 'libinput Accel Speed' 0.4 & +done + From a3af37de8ca4a316366dcafb7b6400a574b81802 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 4 Nov 2022 10:08:13 +0100 Subject: [PATCH 08/11] [mail] feat: add velo subfolder to univ-nantes --- .../neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc b/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc index 8f24f9d..0efc2d5 100644 --- a/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc +++ b/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc @@ -24,7 +24,7 @@ set signature="$XDG_CONFIG_HOME/neomutt/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" "=publications" "=teaching" "=teaching/X11I020" "=teaching/X11I040" "=forge" "=admin" "=login" +mailboxes "=Sent" "=Drafts" "=Trash" "=INBOX" "=thesis" "=publications" "=teaching" "=teaching/X11I020" "=teaching/X11I040" "=forge" "=velo" "=admin" "=login" set record = "+Sent" macro index,pager gs "=Sent" "go to sent" macro index,pager Ms ";=Sent" "move mail to sent" @@ -47,6 +47,9 @@ macro index,pager CT ";=thesis" "copy mail to thesis" macro index,pager gf "=forge" "go to forge" macro index,pager Mf ";=forge" "move mail to forge" macro index,pager Cf ";=forge" "copy mail to forge" +macro index,pager gv "=velo" "go to velo" +macro index,pager Mv ";=velo" "move mail to velo" +macro index,pager Cv ";=velo" "copy mail to velo" macro index,pager ga "=admin" "go to admin" macro index,pager Ma ";=admin" "move mail to admin" macro index,pager Ca ";=admin" "copy mail to admin" From fd74b462fb85435f07c8bc2dcf55839a026b9527 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 4 Nov 2022 10:20:37 +0100 Subject: [PATCH 09/11] [mail] refactor!: simplify mailboxes names !!!BREAKING: check the configuration files to rename the mail directories accordingly --- .config/mbsync/config | 18 +++++++++--------- .config/msmtp/config | 6 +++--- .../accounts/1-david.julien@posteo.net.muttrc | 8 ++++---- .../2-david.julien@univ-nantes.fr.muttrc | 8 ++++---- .../accounts/3-david.julien@mailo.com.muttrc | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.config/mbsync/config b/.config/mbsync/config index 38741eb..856cc3d 100644 --- a/.config/mbsync/config +++ b/.config/mbsync/config @@ -10,10 +10,10 @@ CertificateFile /etc/ssl/certs/ca-certificates.crt MaildirStore david.julien@posteo.net-local Subfolders Verbatim -Path /home/swytch/.local/share/mail/david.julien@posteo.net/ -Inbox /home/swytch/.local/share/mail/david.julien@posteo.net/INBOX +Path /home/swytch/.local/share/mail/posteo/ +Inbox /home/swytch/.local/share/mail/posteo/INBOX -Channel david.julien@posteo.net +Channel posteo Expunge Both Far :david.julien@posteo.net-remote: Near :david.julien@posteo.net-local: @@ -36,10 +36,10 @@ CertificateFile /etc/ssl/certs/ca-certificates.crt MaildirStore david.julien@univ-nantes.fr-local Subfolders Verbatim -Path /home/swytch/.local/share/mail/david.julien@univ-nantes.fr/ -Inbox /home/swytch/.local/share/mail/david.julien@univ-nantes.fr/INBOX +Path /home/swytch/.local/share/mail/univ/ +Inbox /home/swytch/.local/share/mail/univ/INBOX -Channel david.julien@univ-nantes.fr +Channel univ Expunge Both Far :david.julien@univ-nantes.fr-remote: Near :david.julien@univ-nantes.fr-local: @@ -62,10 +62,10 @@ CertificateFile /etc/ssl/certs/ca-certificates.crt MaildirStore david.julien@mailo.com-local Subfolders Verbatim -Path /home/swytch/.local/share/mail/david.julien@mailo.com/ -Inbox /home/swytch/.local/share/mail/david.julien@mailo.com/INBOX +Path /home/swytch/.local/share/mail/mailo/ +Inbox /home/swytch/.local/share/mail/mailo/INBOX -Channel david.julien@mailo.com +Channel mailo Expunge Both Far :david.julien@mailo.com-remote: Near :david.julien@mailo.com-local: diff --git a/.config/msmtp/config b/.config/msmtp/config index 25ea415..4e48a95 100644 --- a/.config/msmtp/config +++ b/.config/msmtp/config @@ -1,4 +1,4 @@ -account david.julien@posteo.net +account posteo host posteo.de port 587 from david.julien@posteo.net @@ -9,7 +9,7 @@ tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile /home/swytch/.config/msmtp/msmtp.log -account david.julien@univ-nantes.fr +account univ host smtp.etu.univ-nantes.fr port 587 from david.julien@univ-nantes.fr @@ -20,7 +20,7 @@ tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile /home/swytch/.config/msmtp/msmtp.log -account david.julien@mailo.com +account mailo host mail.mailo.com port 587 from david.julien@mailo.com diff --git a/.config/neomutt/accounts/1-david.julien@posteo.net.muttrc b/.config/neomutt/accounts/1-david.julien@posteo.net.muttrc index d9adf49..7cc1d88 100644 --- a/.config/neomutt/accounts/1-david.julien@posteo.net.muttrc +++ b/.config/neomutt/accounts/1-david.julien@posteo.net.muttrc @@ -2,11 +2,11 @@ # muttrc file for account email@adress.you set realname = "David JULIEN" set from = "david.julien@posteo.net" -set sendmail = "msmtp -a david.julien@posteo.net" +set sendmail = "msmtp -a posteo" alias me david.julien -set folder = "$XDG_DATA_HOME/mail/david.julien@posteo.net" -set header_cache = "$XDG_CACHE_HOME/neomutt/david.julien@posteo.net/headers" -set message_cachedir = "$XDG_CACHE_HOME/neomutt/david.julien@posteo.net/bodies" +set folder = "$XDG_DATA_HOME/mail/posteo" +set header_cache = "$XDG_CACHE_HOME/neomutt/posteo/headers" +set message_cachedir = "$XDG_CACHE_HOME/neomutt/posteo/bodies" set mbox_type = Maildir set crypt_autosign = yes diff --git a/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc b/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc index 0efc2d5..a889735 100644 --- a/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc +++ b/.config/neomutt/accounts/2-david.julien@univ-nantes.fr.muttrc @@ -2,11 +2,11 @@ # muttrc file for account david.julien@univ-nantes.fr set realname = "David JULIEN" set from = "david.julien@univ-nantes.fr" -set sendmail = "msmtp -a david.julien@univ-nantes.fr" +set sendmail = "msmtp -a univ" alias me david.julien -set folder = "$XDG_DATA_HOME/mail/david.julien@univ-nantes.fr" -set header_cache = "$XDG_CACHE_HOME/neomutt/david.julien@univ-nantes.fr/headers" -set message_cachedir = "$XDG_CACHE_HOME/neomutt/david.julien@univ-nantes.fr/bodies" +set folder = "$XDG_DATA_HOME/mail/univ" +set header_cache = "$XDG_CACHE_HOME/neomutt/univ/headers" +set message_cachedir = "$XDG_CACHE_HOME/neomutt/univ/bodies" set mbox_type = Maildir set crypt_autosign = yes diff --git a/.config/neomutt/accounts/3-david.julien@mailo.com.muttrc b/.config/neomutt/accounts/3-david.julien@mailo.com.muttrc index 74acbd5..f6bf6cf 100644 --- a/.config/neomutt/accounts/3-david.julien@mailo.com.muttrc +++ b/.config/neomutt/accounts/3-david.julien@mailo.com.muttrc @@ -2,11 +2,11 @@ # muttrc file for account email@adress.you set realname = "David JULIEN" set from = "david.julien@mailo.com" -set sendmail = "msmtp -a david.julien@mailo.com" +set sendmail = "msmtp -a mailo" alias me david.julien -set folder = "$XDG_DATA_HOME/mail/david.julien@mailo.com" -set header_cache = "$XDG_CACHE_HOME/neomutt/david.julien@mailo.com/headers" -set message_cachedir = "$XDG_CACHE_HOME/neomutt/david.julien@mailo.com/bodies" +set folder = "$XDG_DATA_HOME/mail/mailo" +set header_cache = "$XDG_CACHE_HOME/neomutt/mailo/headers" +set message_cachedir = "$XDG_CACHE_HOME/neomutt/mailo/bodies" set mbox_type = Maildir set crypt_autosign = yes From 438c25f4ff0dd682a311e00e17dcdbfd7e6e3481 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 4 Nov 2022 14:50:41 +0100 Subject: [PATCH 10/11] [mail] feat: add filters for univ --- .config/notmuch/default/hooks/post-new | 3 +++ .config/notmuch/default/hooks/pre-sync | 27 ++++++++++++++++++++++++++ .local/bin/statusbar/sb-mailbox | 6 +++--- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100755 .config/notmuch/default/hooks/post-new create mode 100755 .config/notmuch/default/hooks/pre-sync diff --git a/.config/notmuch/default/hooks/post-new b/.config/notmuch/default/hooks/post-new new file mode 100755 index 0000000..5e1c658 --- /dev/null +++ b/.config/notmuch/default/hooks/post-new @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +notmuch tag --input $XDG_CONFIG_HOME/notmuch/tags/univ diff --git a/.config/notmuch/default/hooks/pre-sync b/.config/notmuch/default/hooks/pre-sync new file mode 100755 index 0000000..d62bc58 --- /dev/null +++ b/.config/notmuch/default/hooks/pre-sync @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +# Archive files that are NOT tagged Inbox +accounts="univ" + +# Update paths & tags +notmuch new --no-hooks + +filter() { + notmuch search --output=files --format=text0 $parameters and tag:new| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/new/" + notmuch search --output=files --format=text0 $parameters and not tag:new| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/cur/" +} + +for account in $accounts +do + tags_location="$XDG_CONFIG_HOME/notmuch/tags/$account" + tags="$(grep "+" "$tags_location" | sed -e 's/^.//' -e 's/ .*//')" + for tag in $tags + do + [ "univ" = $tag ] && continue + parameters="folder:$account/INBOX and tag:$tag" + filter + done +done + +# Update paths +notmuch new --no-hooks diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox index c2d46be..9f0d45b 100755 --- a/.local/bin/statusbar/sb-mailbox +++ b/.local/bin/statusbar/sb-mailbox @@ -16,9 +16,9 @@ do 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 '/@univ/p')" ] && box="" - [ -n "$(echo "$acc" | sed -n '/@mailo/p')" ] && box="" - [ -n "$(echo "$acc" | sed -n '/@posteo/p')" ] && box="" + [ -n "$(echo "$acc" | sed -n '/univ/p')" ] && box="" + [ -n "$(echo "$acc" | sed -n '/mailo/p')" ] && box="" + [ -n "$(echo "$acc" | sed -n '/posteo/p')" ] && box="" unread="$unread/$box$new" fi done From e28c09a733c09b0bac58b9faec063a9d8c4876fb Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 4 Nov 2022 16:29:48 +0100 Subject: [PATCH 11/11] [mail] fix: filters for univ --- .config/notmuch/default/hooks/post-new | 22 ++++++++++++++++++++- .config/notmuch/default/hooks/pre-sync | 27 -------------------------- 2 files changed, 21 insertions(+), 28 deletions(-) delete mode 100755 .config/notmuch/default/hooks/pre-sync diff --git a/.config/notmuch/default/hooks/post-new b/.config/notmuch/default/hooks/post-new index 5e1c658..0c8b092 100755 --- a/.config/notmuch/default/hooks/post-new +++ b/.config/notmuch/default/hooks/post-new @@ -1,3 +1,23 @@ #!/usr/bin/env sh -notmuch tag --input $XDG_CONFIG_HOME/notmuch/tags/univ +# The accounts to be cleaned +accounts="univ" + +filter() { + notmuch search --output=files --format=text0 $parameters and tag:unread| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/new/" + notmuch search --output=files --format=text0 $parameters and not tag:unread| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/cur/" +} + +for account in $accounts +do + notmuch tag --input $XDG_CONFIG_HOME/notmuch/tags/$account + tags_location="$XDG_CONFIG_HOME/notmuch/tags/$account" + tags="$(grep "+" "$tags_location" | sed -e 's/^.//' -e 's/ .*//')" + for tag in $tags + do + case $tag in + "+univ") ;; + *) parameters="folder:$account/INBOX and tag:$tag" && filter;; + esac + done +done diff --git a/.config/notmuch/default/hooks/pre-sync b/.config/notmuch/default/hooks/pre-sync deleted file mode 100755 index d62bc58..0000000 --- a/.config/notmuch/default/hooks/pre-sync +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env sh - -# Archive files that are NOT tagged Inbox -accounts="univ" - -# Update paths & tags -notmuch new --no-hooks - -filter() { - notmuch search --output=files --format=text0 $parameters and tag:new| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/new/" - notmuch search --output=files --format=text0 $parameters and not tag:new| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/cur/" -} - -for account in $accounts -do - tags_location="$XDG_CONFIG_HOME/notmuch/tags/$account" - tags="$(grep "+" "$tags_location" | sed -e 's/^.//' -e 's/ .*//')" - for tag in $tags - do - [ "univ" = $tag ] && continue - parameters="folder:$account/INBOX and tag:$tag" - filter - done -done - -# Update paths -notmuch new --no-hooks