lemonbar: update workspaces to newer version of i3ipc.
This commit is contained in:
@@ -270,13 +270,13 @@ class i3Module(LemonModule):
|
||||
# Find out which output the workspace is on
|
||||
output = None # TODO actually use this information
|
||||
for output_ in i3ws.outputs:
|
||||
if output_['name'] == workspace['output']:
|
||||
if output_.name == workspace.output:
|
||||
output = output_
|
||||
break
|
||||
if not output:
|
||||
continue
|
||||
status = i3ws.state.get_state(workspace, output) # FOC or INA
|
||||
name = workspace['name'] # e.g. 5 terms
|
||||
name = workspace.name # e.g. 5 terms
|
||||
current = ''.join([parser.block(click=('i3-msg workspace' + name))
|
||||
, name, parser.block(click='')])
|
||||
if status == "FOC":
|
||||
|
||||
@@ -29,12 +29,12 @@ class State(object):
|
||||
urgent = 'URG'
|
||||
|
||||
def get_state(self, workspace, output):
|
||||
if workspace['focused']:
|
||||
if output['current_workspace'] == workspace['name']:
|
||||
if workspace.focused:
|
||||
if output.current_workspace == workspace.name:
|
||||
return self.focused
|
||||
else:
|
||||
return self.active
|
||||
if workspace['urgent']:
|
||||
if workspace.urgent:
|
||||
return self.urgent
|
||||
else:
|
||||
return self.inactive
|
||||
@@ -132,13 +132,13 @@ class i3ws(object):
|
||||
for workspace in workspaces:
|
||||
output = None
|
||||
for output_ in outputs:
|
||||
if output_['name'] == workspace['output']:
|
||||
if output_.name == workspace.output:
|
||||
output = output_
|
||||
break
|
||||
if not output:
|
||||
continue
|
||||
st = self.state.get_state(workspace, output)
|
||||
name = workspace['name'].replace(" ","___")
|
||||
name = workspace.name.replace(" ","___")
|
||||
item= self.ws_format % (st, name)
|
||||
out += item
|
||||
return self.end_format % out
|
||||
|
||||
Reference in New Issue
Block a user