David JULIEN
18fa36a655
git: fix gitignore mail: fix globbing in subdirectories use XDG_DIRECTORIES variables use PGP keys as default keys, not just for signing add keybindings to univ-nantes fix display in statusbar notify only the amount of mail, not content fix timestamp for sync nvim: fix deprecated functions in nvim-cmp change Telescope keymaps prefixes add Telescope keymap for grepping
29 lines
1.0 KiB
Bash
Executable File
29 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
######################################################################
|
|
# @author : swytch (adapted from Luke Smith - lukesmith.xyz)
|
|
# @file : sb-mailbox
|
|
# @license : GPLv3
|
|
# @created : Saturday Feb 13, 2021 18:15:13 CET
|
|
#
|
|
# @description : mail block for dwmblocks
|
|
######################################################################
|
|
|
|
|
|
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 -e "trash" -e "drafts" | wc -l 2>/dev/null)"
|
|
if [ $new -gt 0 ]; then
|
|
box=""
|
|
[ -n "$(echo "$acc" | sed -n '/@centrale/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
|
|
[ -n "$unread" ] && unread="$(echo "$unread" | cut -c 2-)" || exit
|
|
|
|
printf " %s%s " "$unread" "$icon"
|