diff options
-rwxr-xr-x | localikiwatchstyling | 25 |
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" |