@requires_segment_info
def workspace(pl, segment_info, workspace=None, strip=False):
 if workspace:
  try:
   w = next((w for w in get_i3_connection().get_workspaces() if (w[u'name'] == workspace)))
  except StopIteration:
   return None
 elif segment_info.get(u'workspace'):
  w = segment_info[u'workspace']
 else:
  try:
   w = next((w for w in get_i3_connection().get_workspaces() if w[u'focused']))
  except StopIteration:
   return None
 return [{u'contents': format_name(w[u'name'], strip=strip), u'highlight_groups': workspace_groups(w)}]

@ requires_segment_info def workspace ( pl , segment_info , workspace = None , strip = False ) : if workspace : try : w = next ( ( w for w in get_i3_connection ( ) . get_workspaces ( ) if ( w [ u'name' ] == workspace ) ) ) except StopIteration : return None elif segment_info . get ( u'workspace' ) : w = segment_info [ u'workspace' ] else : try : w = next ( ( w for w in get_i3_connection ( ) . get_workspaces ( ) if w [ u'focused' ] ) ) except StopIteration : return None return [ { u'contents' : format_name ( w [ u'name' ] , strip = strip ) , u'highlight_groups' : workspace_groups ( w ) } ]
yaml: workspace specifies the cloned workspace for this job to use as a scm source .