From 5eb6cf043930ffc230c1681bd61e7d283f6ee537 Mon Sep 17 00:00:00 2001 From: joe Date: Fri, 3 Oct 2025 11:31:23 +0200 Subject: up --- .local/bin/fetch_mail | 34 ++++++++++++++++++---------------- .local/bin/ndate | 2 +- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to '.local') diff --git a/.local/bin/fetch_mail b/.local/bin/fetch_mail index 2002ce3..0c743ec 100755 --- a/.local/bin/fetch_mail +++ b/.local/bin/fetch_mail @@ -26,7 +26,10 @@ sub get_new_mail my $ret; system('killall mbsync >/dev/null 2>&1'); - system('mbsync', $acc); + $ret = system('mbsync', 'qwe'); + if ($ret != 0) { + notify(" $acc: failed to sync mails"); + } return; } @@ -56,6 +59,20 @@ sub count_new_mails sub fetch_thread { + return; +} + +sub fetch_mail +{ + $ENV{'MAIL'} = $HOME . '/.local/share/mail'; + $ENV{'GNUPGHOME'} = $HOME . '/.local/share/gnupg'; + $ENV{'PASSWORD_STORE_DIR'} = $HOME . '/.local/share/pass'; + my $maildir = $ENV{'MAIL'} . '/'; + # my $notify_str = " new mails\n"; + + # test gpg + my @accs = get_all_accounts(); + foreach (@accs) { my $pre_count = -1; my $mc_file = MC_FILE_PATH . $_; my $fh; @@ -79,21 +96,6 @@ sub fetch_thread seek($fh, 0, 0); print $fh "$post_count"; close($fh); - return; -} - -sub fetch_mail -{ - $ENV{'MAIL'} = $HOME . '/.local/share/mail'; - $ENV{'GNUPGHOME'} = $HOME . '/.local/share/gnupg'; - $ENV{'PASSWORD_STORE_DIR'} = $HOME . '/.local/share/pass'; - my $maildir = $ENV{'MAIL'} . '/'; - # my $notify_str = " new mails\n"; - my $og_length = length($notify_str); - - # test gpg - my @accs = get_all_accounts(); - foreach (@accs) { } # notify($notify_str) if (length($notify_str) > $og_length); return; diff --git a/.local/bin/ndate b/.local/bin/ndate index 372d0cd..460cf1d 100755 --- a/.local/bin/ndate +++ b/.local/bin/ndate @@ -11,4 +11,4 @@ # == ================ # ===================== -exec herbe "$(date '+%H:%M | %a, %d %b %Y')" +exec herbe " $(date '+%H:%M | %a, %d %b %Y')" -- cgit v1.2.3