From 3c391fa81db23666df0fd238267795126338bf43 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 11 Feb 2020 17:37:58 +0100 Subject: contrib: add hotreload script --- contrib/hotreload.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 contrib/hotreload.sh (limited to 'contrib') diff --git a/contrib/hotreload.sh b/contrib/hotreload.sh new file mode 100755 index 0000000..98d9bf3 --- /dev/null +++ b/contrib/hotreload.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Watch themes and plugins files, automatically reload koushin on change. + +events=modify,create,delete,move +targets="themes/ plugins/" + +inotifywait -e "$events" -m -r $targets | while read line; do + jobs + if [ -z "$(jobs -p)" ]; then + (sleep 0.5 && pkill -USR1 koushin) & + fi +done -- cgit v1.2.3