aboutsummaryrefslogtreecommitdiff
path: root/contrib/hotreload.sh
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-02-11 17:37:58 +0100
committerSimon Ser <contact@emersion.fr>2020-02-11 17:37:58 +0100
commit3c391fa81db23666df0fd238267795126338bf43 (patch)
tree69e8a0deca7adc2f742500cf58a8e7e46ab41ffa /contrib/hotreload.sh
parent82304a78d61f14de897fb6dba70f4b17fb396217 (diff)
downloadalps-3c391fa81db23666df0fd238267795126338bf43.tar.gz
alps-3c391fa81db23666df0fd238267795126338bf43.zip
contrib: add hotreload script
Diffstat (limited to 'contrib/hotreload.sh')
-rwxr-xr-xcontrib/hotreload.sh13
1 files changed, 13 insertions, 0 deletions
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