2 # vim:ts=4:sw=4:expandtab
3 # © 2012 Michael Stapelberg, Public Domain
5 # This script is a trivial shell script to send your own output to i3bar while
6 # using the JSON protocol.
8 # It is ugly and that is inherent to using JSON with shell scripts. You
9 # _really_ should not do that. See i3status or i3status’s contrib/ directory
10 # for examples of how to handle the output in higher-level languages.
12 # This example is purely for illustration of the protocol. DO NOT USE IT IN THE
15 # Send the header so that i3bar knows we want to use JSON:
16 echo '{ "version": 1 }'
18 # Begin the endless array.
21 # We send an empty first array of blocks to make the loop simpler:
24 # Now send blocks with information forever:
27 echo ",[{\"name\":\"time\",\"full_text\":\"$(date)\"}]"