From f5eba51c523722eeafae6742dcc5faed09b25b2f Mon Sep 17 00:00:00 2001 From: AAGaming Date: Wed, 3 Jul 2024 20:43:08 -0400 Subject: set process/thread titles for decky and plugins sadly requires the `setproctitle` pypi module because python doesn't have a builtin to do this :/ --- backend/decky_loader/plugin/sandboxed_plugin.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backend/decky_loader/plugin/sandboxed_plugin.py') diff --git a/backend/decky_loader/plugin/sandboxed_plugin.py b/backend/decky_loader/plugin/sandboxed_plugin.py index 083a6749..07b04e7d 100644 --- a/backend/decky_loader/plugin/sandboxed_plugin.py +++ b/backend/decky_loader/plugin/sandboxed_plugin.py @@ -7,6 +7,7 @@ from sys import exit, path as syspath, modules as sysmodules from traceback import format_exc from asyncio import (get_event_loop, new_event_loop, set_event_loop, sleep) +from setproctitle import setproctitle, setthreadtitle from .messages import SocketResponseDict, SocketMessageType from ..localplatform.localsocket import LocalSocket @@ -48,6 +49,9 @@ class SandboxedPlugin: signal(SIGINT, SIG_IGN) signal(SIGTERM, SIG_IGN) + setproctitle(f"{self.name} ({self.file})") + setthreadtitle(self.name) + set_event_loop(new_event_loop()) if self.passive: return -- cgit v1.2.3