@requires_segment_info
def workspace_lister(pl, segment_info, only_show=None, output=None):
 if (output == None):
  output = (output or segment_info.get(u'output'))
 return ((updated(segment_info, output=w[u'output'], workspace={u'name': w[u'name'], u'visible': w[u'visible'], u'urgent': w[u'urgent'], u'focused': w[u'focused']}), {u'draw_inner_divider': None}) for w in get_i3_connection().get_workspaces() if (((not only_show) or any((w[typ] for typ in only_show))) and ((not output) or (w[u'output'] == output))))

@ requires_segment_info def workspace_lister ( pl , segment_info , only_show = None , output = None ) : if ( output == None ) : output = ( output or segment_info . get ( u'output' ) ) return ( ( updated ( segment_info , output = w [ u'output' ] , workspace = { u'name' : w [ u'name' ] , u'visible' : w [ u'visible' ] , u'urgent' : w [ u'urgent' ] , u'focused' : w [ u'focused' ] } ) , { u'draw_inner_divider' : None } ) for w in get_i3_connection ( ) . get_workspaces ( ) if ( ( ( not only_show ) or any ( ( w [ typ ] for typ in only_show ) ) ) and ( ( not output ) or ( w [ u'output' ] == output ) ) ) )
list all workspaces in segment_info format sets the segment info values of workspace and output to the name of the i3 workspace and the xrandr output respectively and the keys "visible" .