This repository has been archived on 2022-01-04. You can view files and clone it, but cannot push or open issues/pull-requests.

30 lines
833 B
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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