2 # -*- coding: utf-8 -*-
4 # Inspired by http://code.stapelberg.de/git/i3status/tree/contrib/wrapper.py
10 def print_nonbuffered(message):
11 sys.stdout.write(message)
14 if __name__ == '__main__':
15 print_nonbuffered(sys.stdin.readline())
16 print_nonbuffered(sys.stdin.readline())
18 line, prefix = sys.stdin.readline(), ''
19 if line.startswith(','):
20 line, prefix = line[1:], ','
22 if '1' == subprocess.getoutput('xset q | grep LED')[65]:
23 j.insert(len(j), {'full_text' : 'CAPS',
24 'separator_block_width': 40,
26 print_nonbuffered(prefix+json.dumps(j))