diff options
-rwxr-xr-x | mbsyncloop/.bin/mbsyncloop (renamed from local/.bin/mbsyncloop) | 9 | ||||
-rw-r--r-- | mbsyncloop/.config/systemd/user/mbsyncloop.service | 6 | ||||
-rwxr-xr-x | mbsyncloop/.services/available/mbsyncloop/log/run | 4 | ||||
-rwxr-xr-x | mbsyncloop/.services/available/mbsyncloop/run | 3 | ||||
-rw-r--r-- | mbsyncloop/Makefile | 9 | ||||
-rw-r--r-- | mutt/.config/mutt/local | 2 |
6 files changed, 21 insertions, 12 deletions
diff --git a/local/.bin/mbsyncloop b/mbsyncloop/.bin/mbsyncloop index a1cf181..bb16df1 100755 --- a/local/.bin/mbsyncloop +++ b/mbsyncloop/.bin/mbsyncloop @@ -9,6 +9,11 @@ use File::Temp; use JSON::PP; use POSIX 'mkfifo'; +# running a local build until +# https://gitlab.com/shackra/goimapnotify/-/merge_requests/14 makes it into a +# release +my $GOIMAPNOTIFY = "$ENV{HOME}/.bin/local/goimapnotify"; + my $RUN_DIR = make_run_dir(); my ($PW_PID, $GOIMAPNOTIFY_PID); @@ -124,7 +129,7 @@ sub read_mailboxes { my $tmp = File::Temp->new(DIR => $RUN_DIR); $tmp->print(JSON::PP::encode_json($config)); $tmp->flush; - open my $fh, '-|', 'goimapnotify', '--conf', $tmp->filename, '--list' + open my $fh, '-|', $GOIMAPNOTIFY, '--conf', $tmp->filename, '--list' or die "couldn't run goimapnotify: $!"; <$fh>; @@ -179,7 +184,7 @@ sub spawn_goimapnotify_proc { $tmp->flush; while (1) { - open my $fh, '-|', 'goimapnotify', '--conf', $tmp->filename + open my $fh, '-|', $GOIMAPNOTIFY, '--conf', $tmp->filename or die "couldn't run goimapnotify: $!"; while (<$fh>) { $goimapnotify_w->print("N\n"); diff --git a/mbsyncloop/.config/systemd/user/mbsyncloop.service b/mbsyncloop/.config/systemd/user/mbsyncloop.service new file mode 100644 index 0000000..c53e989 --- /dev/null +++ b/mbsyncloop/.config/systemd/user/mbsyncloop.service @@ -0,0 +1,6 @@ +[Service] +ExecStart=%h/.bin/mbsyncloop +Restart=always + +[Install] +WantedBy=default.target diff --git a/mbsyncloop/.services/available/mbsyncloop/log/run b/mbsyncloop/.services/available/mbsyncloop/log/run deleted file mode 100755 index 5930eda..0000000 --- a/mbsyncloop/.services/available/mbsyncloop/log/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -eu - -exec multilog t s16777215 "$HOME/.log/mbsyncloop" diff --git a/mbsyncloop/.services/available/mbsyncloop/run b/mbsyncloop/.services/available/mbsyncloop/run deleted file mode 100755 index ac7e636..0000000 --- a/mbsyncloop/.services/available/mbsyncloop/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec mbsyncloop 2>&1 diff --git a/mbsyncloop/Makefile b/mbsyncloop/Makefile index 5997d23..b095cbd 100644 --- a/mbsyncloop/Makefile +++ b/mbsyncloop/Makefile @@ -1,4 +1,9 @@ include ../Makefile.include -install: $(HOME)/.services/enabled/mbsyncloop - @mkdir -p $(HOME)/.log/mbsyncloop +install: + @systemctl --user enable mbsyncloop + @systemctl --user start mbsyncloop + +uninstall: + @systemctl --user stop mbsyncloop + @systemctl --user disable mbsyncloop diff --git a/mutt/.config/mutt/local b/mutt/.config/mutt/local index a4fea33..636bd29 100644 --- a/mutt/.config/mutt/local +++ b/mutt/.config/mutt/local @@ -10,7 +10,7 @@ mailboxes `\ echo -n "\"=$basename\" ";\ fi\ done` -macro index R "<enter-command>unset wait_key<enter><shell-escape>svc -h ~/.services/enabled/mbsyncloop<enter><enter-command>set wait_key<enter>" "fetch mail with mbsync" +macro index R "<enter-command>unset wait_key<enter><shell-escape>kill -HUP $(systemctl --user show --property MainPID --value mbsyncloop)<enter><enter-command>set wait_key<enter>" "fetch mail with mbsync" set timeout=3 # vim: ft=neomuttrc |