Removed some old/unneeded shell scripts and formatted the rest

This commit is contained in:
Marko Korhonen 2022-09-16 20:08:03 +03:00
parent 86ba9538de
commit 7e48c8f75a
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
15 changed files with 51 additions and 369 deletions

View file

@ -5,20 +5,19 @@ COUNT=$(ls $NEWMAILDIR | wc -l)
ICON=/usr/share/icons/Papirus-Dark/64x64/apps/email.svg
SOUND=/usr/share/sounds/Oxygen-Im-Message-In.ogg
if [ $COUNT -ne 0 ]; then
mpv $SOUND &
mpv $SOUND &
fi
if [ $COUNT -gt 1 ]; then
fromaddress=$(cat $NEWMAILDIR/$(ls $NEWMAILDIR | sort -R | tail -1) | formail -x From | tail -1)
notify-send.sh -i $ICON "$COUNT new messages in $1" "From $fromaddress and others"
fromaddress=$(cat $NEWMAILDIR/$(ls $NEWMAILDIR | sort -R | tail -1) | formail -x From | tail -1)
notify-send.sh -i $ICON "$COUNT new messages in $1" "From $fromaddress and others"
elif [ $COUNT -eq 1 ]; then
mailsubject=$(cat $NEWMAILDIR/* | formail -x Subject)
fromaddress=$(cat $NEWMAILDIR/* | formail -x From | tail -1)
mailsubject=$(cat $NEWMAILDIR/* | formail -x Subject)
fromaddress=$(cat $NEWMAILDIR/* | formail -x From | tail -1)
notify-send.sh -i $ICON "New message in $1" "$fromaddress $mailsubject"
notify-send.sh -i $ICON "New message in $1" "$fromaddress $mailsubject"
else
echo "No new mail"
echo "No new mail"
fi