summaryrefslogtreecommitdiff
path: root/localikiwatchstyling
blob: 9ecb3052e27657ae27277b7dc94a4f6b6a7d8ba3 (plain)
  1. #!/bin/sh
  2. #
  3. # /usr/local/bin/localikiwatchstyling
  4. # Copyright 2014 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # Watch Ikiwiki styling and regenerate when changing
  7. #
  8. # Depends: ruby-compass, inotify-hookable
  9. # Recommends: libnotify-bin
  10. set -e
  11. stem=
  12. if [ -f styling/style.scss ]; then
  13. stem=style
  14. elif [ -f styling/local.scss ]; then
  15. stem=local
  16. else
  17. echo "Couldn't locate either style.scss or local.scss in styling dir."
  18. exit 1
  19. fi
  20. set +e
  21. inotify-hookable -f styling/$stem.scss \
  22. -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"