From 6b17459e22149bccff3173d67de92991cd605fc7 Mon Sep 17 00:00:00 2001 From: Osmo Salomaa Date: Fri, 11 Oct 2024 23:17:16 +0300 Subject: [PATCH] Don't even index apps with no command line --- NEWS.md | 5 +++++ catapult/plugins/apps.py | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index a2b3a1b..e184e19 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +PENDING: Catapult 1.2 +===================== + +* Don't index apps with no command line (#32) + 2024-10-06: Catapult 1.1 ======================== diff --git a/catapult/plugins/apps.py b/catapult/plugins/apps.py index f7a7e87..056a3bb 100644 --- a/catapult/plugins/apps.py +++ b/catapult/plugins/apps.py @@ -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() @@ -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