aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorgretchen <gretchen@gnar.cool>2019-11-18 16:33:03 -0800
committergretchen <gretchen@gnar.cool>2019-11-18 16:33:03 -0800
commit228baf459707bae2ad67029a71fbfad674d7324a (patch)
tree8797b8a56ff3b6ddb8bb1cebd2ed7ff073991a8a /example
parent4e4deba4b4b305b097bd5406b671e3b84a77ebb5 (diff)
downloadnorns-etc-228baf459707bae2ad67029a71fbfad674d7324a.tar.gz
norns-etc-228baf459707bae2ad67029a71fbfad674d7324a.zip
Example and documentation for emacs integration.
Diffstat (limited to 'example')
-rw-r--r--example/Makefile9
-rw-r--r--example/example.lua22
2 files changed, 31 insertions, 0 deletions
diff --git a/example/Makefile b/example/Makefile
new file mode 100644
index 0000000..bbaebf9
--- /dev/null
+++ b/example/Makefile
@@ -0,0 +1,9 @@
+NORNS=norns.local
+
+all:
+
+upload: example.lua
+ find . -not -path '*/\.*' -type f -exec norns_upload example "{}" \;
+ norns_load example example.lua
+
+.PHONY: all upload
diff --git a/example/example.lua b/example/example.lua
new file mode 100644
index 0000000..e96ba34
--- /dev/null
+++ b/example/example.lua
@@ -0,0 +1,22 @@
+-- An example script for norns-etc
+-- Load this file in emacs and M-x compile to upload.
+
+function redraw()
+ screen.clear()
+ screen.move(64, 32)
+ screen.text_center("norns example #" .. math.floor(math.random() * 1000))
+ screen.update()
+end
+
+
+function init()
+ redraw()
+end
+
+-- This needs to be at the end so that it doesn't conflict with the
+-- norns convention of having a script description in comments on the
+-- first couple of lines.
+
+-- Local Variables:
+-- compile-command: "make upload"
+-- End: