Skip to content

Commit

Permalink
Don't even index apps with no command line
Browse files Browse the repository at this point in the history
  • Loading branch information
otsaloma committed Oct 11, 2024
1 parent cf61852 commit 6b17459
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
PENDING: Catapult 1.2
=====================

* Don't index apps with no command line (#32)

2024-10-06: Catapult 1.1
========================

Expand Down
6 changes: 2 additions & 4 deletions catapult/plugins/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ def __init__(self):

def _get_description(self, app):
description = app.get_commandline()
if description is None:
return
description = re.sub(r" %\w\b", "", description)
description = re.sub(r" --$", "", description)
return description.strip()
Expand All @@ -80,8 +78,8 @@ def launch(self, window, id):
def _list_apps(self):
key = lambda x: x.get_filename().lower()
for app in sorted(Gio.AppInfo.get_all(), key=key):
if not self.conf.ignore_only_show_in:
if not app.should_show(): continue
if not self.conf.ignore_only_show_in and not app.should_show(): continue
if not app.get_commandline(): continue
id = app.get_id()
if id == "io.otsaloma.catapult.desktop": continue
yield id, app
Expand Down

0 comments on commit 6b17459

Please sign in to comment.