diff options
author | Ben Sima <ben@bsima.me> | 2020-12-04 11:16:25 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-12-05 07:55:13 -0500 |
commit | 330e4363d8abb509031d2c8c1a89dcc6f955e2c1 (patch) | |
tree | 915c8c50a7125bf6eb9e560f8d00a80592f41c77 /Biz/Que/Quescripts.md | |
parent | 32f53350a3a3d701e9a1474e670a8454342adc40 (diff) |
Renamespace Devalloc and Que
Move them under the Biz root so that we know they are specific to Biz stuff. Biz
is for proprietary stuff that we own.
I also had to refactor the bild namespace parsing code because it couldn't
handle a namespace with 3 parts. I really need to get that namespace library
written and tested.
Diffstat (limited to 'Biz/Que/Quescripts.md')
-rw-r--r-- | Biz/Que/Quescripts.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Biz/Que/Quescripts.md b/Biz/Que/Quescripts.md new file mode 100644 index 0000000..77e7004 --- /dev/null +++ b/Biz/Que/Quescripts.md @@ -0,0 +1,50 @@ +% Quescripts + +## Remote desktop notifications + +Lets say we are running a job that takes a long time, maybe we are +compiling or running a large test suite. Instead of watching the +terminal until it completes, or flipping back to check on it every so +often, we can create a listener that displays a popup notification when +the job finishes. + +In one terminal run the listener: + + que pub/notify --then "notify-send '{que}' '{msg}'" + +In some other terminal run the job that takes forever: + + runtests ; echo "tests are done" | que pub/notify - + +When terminal 2 succeeds, terminal 1 will print "tests are done", then +call the `notify-send` command, which displays a notification toast in +Linux with title "`pub/notify`" and content "`tests are done`". + +Que paths are multi-producer and multi-consumer, so you can add as many +terminals as you want. + +On macOS you could use something like this (just watch your quotes): + + osascript -e "display notification \"{msg}\" with title \"{que}\"" + +in place of notify-send. + +## Ephemeral, serverless chat rooms + +coming soon + +## Collaborative jukebox + +It's surprisingly easy to make a collaborative jukebox. + +First start up a music player: + + que --poll pub/music --then "playsong '{msg}'" + +where `playsong` is a script that plays a file from data streaming to +`stdin`. For example [vlc](https://www.videolan.org/vlc/) does this when +you run it like `vlc -`. + +Then, anyone can submit songs with: + + que pub/music song.mp3 |