dotter

graphiz helpers
git clone git://deadbeef.fr/dotter.git
Log | Files | Refs | README | LICENSE

commit 4684b2819766c97c7382737b9c8014295954c27f
parent d21c75113a6ebaec042e04aee4f4945ee35c6728
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date:   Fri,  4 Dec 2020 18:16:24 +0100

watcher: no longer try to work if source does not exists yet

Diffstat:
Mwatcher | 15++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/watcher b/watcher @@ -8,9 +8,14 @@ TPID="" while true do FOCUS=$(xdotool getwindowfocus -f) - ./$SCRIPT "${SOURCE}" | dot -Tpdf | $VIEWER & - TPID=$! - xdotool sleep 0.1 windowfocus --sync $FOCUS - inotifywait "${SOURCE}" - kill $TPID + if test -e "$SOURCE" + then + ./$SCRIPT "${SOURCE}" | dot -Tpdf | $VIEWER & + TPID=$! + xdotool sleep 0.1 windowfocus --sync $FOCUS + inotifywait "${SOURCE}" + kill $TPID + else + sleep 1s + fi done