summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-02-05 16:01:49 -0500
committerJesse Luehrs <doy@tozt.net>2022-02-07 19:03:14 -0500
commit4b0677115ee825ce5d1749501a94214c5a51a453 (patch)
tree759c38ffb99d11b078962786936007eeb01c3a4e
parent9ba3a41b193d8ff941ce4df122c7c73c00e645d4 (diff)
downloadconf-4b0677115ee825ce5d1749501a94214c5a51a453.tar.gz
conf-4b0677115ee825ce5d1749501a94214c5a51a453.zip
refactor
-rwxr-xr-xbin/mbsyncloop10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/mbsyncloop b/bin/mbsyncloop
index 967053c..cb77303 100755
--- a/bin/mbsyncloop
+++ b/bin/mbsyncloop
@@ -5,12 +5,16 @@ use warnings;
use POSIX 'mkfifo';
-my $pw = `rbw get mail.tozt.net doy\@tozt.net`;
+my $password_command = "rbw get mail.tozt.net doy\@tozt.net";
+my $mbsync_config = "~/.mbsyncloop";
+my $goimapnotify_config = "~/.config/imapnotify/tozt.conf";
+
+my $pw = `$password_command`;
if ($?) {
die "failed to fetch password: command returned $?";
}
-open my $goimapnotify, '-|', "sh", "-c", "while true; do goimapnotify --conf ~/.config/imapnotify/tozt.conf 2>&1; done" or die "couldn't run goimapnotify: $!";
+open my $goimapnotify, '-|', "sh", "-c", "while true; do goimapnotify --conf '$goimapnotify_config' 2>&1; done" or die "couldn't run goimapnotify: $!";
my ($pw_pipe, $pid);
@@ -52,7 +56,7 @@ while (1) {
sub sync {
my ($channel) = @_;
while (1) {
- my $status = system("mbsync -c ~/.mbsyncloop $channel");
+ my $status = system("mbsync -c '$mbsync_config' $channel");
if (!$status) {
system("notmuch new | grep -v '^No new mail\.\$'");
last;