roundabout,
created on Friday, 20 December 2024, 19:54:54 (1734724494),
received on Friday, 20 December 2024, 19:54:57 (1734724497)
Author identity: vlad <vlad.muntoiu@gmail.com>
93dab47724c9a82a1fbd16b3514c5d80bfbc746c
src/applications/__init__.py
@@ -3,7 +3,6 @@ from xdg import DesktopEntry
from pathlib import Path import subprocess import logging from gi.repository import Gioimport os import gettext import izvor_utils as izvor
@@ -16,7 +15,12 @@ def _get_all_menu_entries():
Path.home() / ".local/share/applications", ] system_directories = [Path(dir) / "applications" for dir in os.environ["XDG_DATA_DIRS"].split(":")]system_directories = [ Path("/usr/share/applications"), ] if os.getenv("FLATPAK_SANDBOX_DIR"): system_directories = [Path("/run/host") / directory.relative_to("/") for directory in system_directories]directories = user_directories + system_directories
@@ -49,8 +53,7 @@ class Provider(izvor.Provider):
for entry, desktop_file in _get_all_menu_entries(): if _match_query(entry, query): def execute(desktop_file=desktop_file): app_info = Gio.DesktopAppInfo.new_from_filename(str(desktop_file))izvor.run_desktop_entry(app_info)izvor.run_desktop_entry(str(desktop_file))yield { "name": entry.getName() or desktop_file.stem,
src/files/__init__.py
@@ -4,6 +4,7 @@ import logging
from pathlib import Path import gettext import izvor_utils as izvor import os_ = gettext.gettext
@@ -44,11 +45,18 @@ class Provider(izvor.Provider):
"execute": execute } process = await asyncio.create_subprocess_exec("locate", query,command = ["locate", query,"-r", str(Path(self.config["path"]).expanduser().resolve()) + "/*", "-i" if self.config["case_insensitive"] else "",*("-l", str(self.config["limit"])) if self.config["limit"] > 0 else (),"-i" if self.config["case_insensitive"] else ""] if self.config["limit"] > 0: command.extend(["-l", str(self.config["limit"])]) if os.getenv("FLATPAK_SANDBOX_DIR"): command = ["flatpak-spawn", "--host"] + command process = await asyncio.create_subprocess_exec( *command,stdout=subprocess.PIPE, stderr=subprocess.PIPE )