.dist
This commit is contained in:
parent
99b1e003cb
commit
4966f90775
@ -100,12 +100,7 @@ class JSONIO:
|
|||||||
|
|
||||||
class I3statusHandler:
|
class I3statusHandler:
|
||||||
modules = []
|
modules = []
|
||||||
|
file = sys.stdin
|
||||||
def __init__(self, fd=None):
|
|
||||||
if fd is None:
|
|
||||||
fd = sys.stdin
|
|
||||||
|
|
||||||
self.io = JSONIO(IOHandler(fd))
|
|
||||||
|
|
||||||
def register(self, module, position=0):
|
def register(self, module, position=0):
|
||||||
"""Register a new module."""
|
"""Register a new module."""
|
||||||
@ -115,6 +110,6 @@ class I3statusHandler:
|
|||||||
module.registered(self)
|
module.registered(self)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
for j in self.io.read():
|
for j in JSONIO(IOHandler(self.file)).read():
|
||||||
for module in self.modules:
|
for module in self.modules:
|
||||||
j.insert(module.position, module.output)
|
j.insert(module.position, module.output)
|
||||||
|
@ -12,6 +12,12 @@ from i3pystatus import (
|
|||||||
|
|
||||||
status = I3statusHandler()
|
status = I3statusHandler()
|
||||||
|
|
||||||
|
# If you want to start i3status automatically with i3pystatus,
|
||||||
|
# uncomment the following lines
|
||||||
|
#import subprocess
|
||||||
|
#process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||||
|
#status.file = process.stdout
|
||||||
|
|
||||||
# Regular expression file watcher
|
# Regular expression file watcher
|
||||||
# If you're using a thinkpad, chances are that this displays your fan speed and level
|
# If you're using a thinkpad, chances are that this displays your fan speed and level
|
||||||
regexsettings = {
|
regexsettings = {
|
||||||
|
Loading…
Reference in New Issue
Block a user