run notmuch with runit

This commit is contained in:
Felix Van der Jeugt 2017-06-23 11:58:13 +02:00
parent 7887de9492
commit 19c48412cc
No known key found for this signature in database
GPG Key ID: 58B209295023754D
3 changed files with 20 additions and 11 deletions

View File

@ -1,11 +0,0 @@
from alot.commands.globals import ExternalCommand
def loop_hook(ui=None):
ui.apply_command(ExternalCommand(
["notmuch", "new", "--quiet"],
thread=True,
))
if ui and ui.current_buffer:
ui.update()

15
services/notmuch/notmuch Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
# check for internet connection
ip route ls | grep -v '' && exit 1
# check if the gpg-agent is running
if ! pgrep gpg-agent >/dev/null; then
notify-send "no gpg-agent"
sleep 10
exit 2
fi
while notmuch --config="$HOME/.notmuch-config" new --quiet 2>&1 | grep -v "Ignoring" | xargs -0 --no-run-if-empty notify-send && sleep 3m; do
true
done

5
services/notmuch/run Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
exec env \
HOME="${HOME:-/home/noctua}" \
DISPLAY="${DISPLAY:-:0}" \
./notmuch