If one wants to run i3status as a subprocess of
i3pystatus, do it like this:
import subprocess
import io
...
process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE)
stdin = io.TextIOWrapper(process.stdout)
status = I3statusHandler(stdin)
exploited_language_features += 2;
(I also exploit the mutability of the list-object here,
yield j binds the list to the context,
when the context is leaved execution continues and the
modified j is written back)
Allows to run i3status directly from your __main__, like this:
status.register(...) # and so on
process = subprocess.Popen("i3status", stdout=subprocess.PIPE)
status.fd = process.stdout
# start the handler
status.run()