summaryrefslogtreecommitdiff
path: root/localikiwatchstyling
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-04-28 13:04:03 +0200
committerJonas Smedegaard <dr@jones.dk>2014-04-28 13:04:14 +0200
commit6599236325b1db3d57bb0428fd97affa4caaaf0e (patch)
treed33eb9909d843a9d446777f68ab22fb2cd2963db /localikiwatchstyling
parent585f82d39da29febe00fbb7f7989de4a7671b088 (diff)
Add new script localikiwatchstyling.
Diffstat (limited to 'localikiwatchstyling')
-rwxr-xr-xlocalikiwatchstyling25
1 files changed, 25 insertions, 0 deletions
diff --git a/localikiwatchstyling b/localikiwatchstyling
new file mode 100755
index 0000000..9ecb305
--- /dev/null
+++ b/localikiwatchstyling
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# /usr/local/bin/localikiwatchstyling
+# Copyright 2014 Jonas Smedegaard <dr@jones.dk>
+#
+# Watch Ikiwiki styling and regenerate when changing
+#
+# Depends: ruby-compass, inotify-hookable
+# Recommends: libnotify-bin
+
+set -e
+
+stem=
+if [ -f styling/style.scss ]; then
+ stem=style
+elif [ -f styling/local.scss ]; then
+ stem=local
+else
+ echo "Couldn't locate either style.scss or local.scss in styling dir."
+ exit 1
+fi
+
+set +e
+inotify-hookable -f styling/$stem.scss \
+ -c "scss --compass -g styling/$stem.scss:styling/$stem.css && cp styling/$stem.css build/html/$stem.css && if [ -n "$DISPLAY" ] && [ -e /usr/bin/notify-send ]; then notify-send 'CSS updated' 'Ikiwiki $stem.css auto-updated from styling/$stem.scss'; fi"