Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def defaultTrigger(self):
return 'w '

def handleTriggerQuery(self, query):
results = []
try:
for line in subprocess.check_output(['wmctrl', '-l', '-x']).splitlines():
win = Window(*parseWindow(line))
Expand All @@ -44,7 +45,7 @@ def handleTriggerQuery(self, query):

m = Matcher(query.string)
if not query.string or m.match(win_instance + ' ' + win_class + ' ' + win.wm_name):
query.add(StandardItem(
results.append(StandardItem(
id="%s%s" % (md_name, win.wm_class),
iconUrls=["xdg:%s" % win_instance],
text="%s - Desktop %s" % (win_class.replace('-', ' '), win.desktop),
Expand All @@ -61,7 +62,7 @@ def handleTriggerQuery(self, query):
))
except subprocess.CalledProcessError as e:
warning(f"Error executing wmctrl: {str(e)}")

query.add(results)

def parseWindow(line):
win_id, desktop, rest = line.decode().split(None, 2)
Expand Down