Skip to content

Commit

Permalink
Added title attribute to Con objects
Browse files Browse the repository at this point in the history
  • Loading branch information
alkim0 committed Nov 15, 2018
1 parent e9fcefa commit 34ea24e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions i3ipc/i3ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ class Con(object):
find_fullscreen
find_marked
find_named
find_titled
floating
floating_nodes
fullscreen_mode
Expand Down Expand Up @@ -1032,13 +1033,16 @@ def __init__(self, data, parent, conn):
self.window_class = None
self.window_instance = None
self.window_role = None
self.title = None
if 'window_properties' in data:
if 'class' in data['window_properties']:
self.window_class = data['window_properties']['class']
if 'instance' in data['window_properties']:
self.window_instance = data['window_properties']['instance']
if 'window_role' in data['window_properties']:
self.window_role = data['window_properties']['window_role']
if 'title' in data['window_properties']:
self.title = data['window_properties']['title']

self.rect = Rect(data['rect'])
if 'window_rect' in data:
Expand Down Expand Up @@ -1180,6 +1184,9 @@ def find_by_role(self, pattern):
def find_named(self, pattern):
return [c for c in self if c.name and re.search(pattern, c.name)]

def find_titled(self, pattern):
return [c for c in self if c.title and re.search(pattern, c.title)]

def find_classed(self, pattern):
return [
c for c in self
Expand Down

0 comments on commit 34ea24e

Please sign in to comment.