summaryrefslogtreecommitdiff
path: root/backend/decky_loader/plugin/sandboxed_plugin.py
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2024-07-03 20:43:08 -0400
committerAAGaming <aagaming@riseup.net>2024-07-03 20:43:08 -0400
commitf5eba51c523722eeafae6742dcc5faed09b25b2f (patch)
tree3b6b7ee48d57fde058b1b8e6efe77a2ce8bf1a44 /backend/decky_loader/plugin/sandboxed_plugin.py
parent83972972f306617b414204d4ff095ca7c0e318f4 (diff)
downloaddecky-loader-f5eba51c523722eeafae6742dcc5faed09b25b2f.tar.gz
decky-loader-f5eba51c523722eeafae6742dcc5faed09b25b2f.zip
set process/thread titles for decky and plugins
sadly requires the `setproctitle` pypi module because python doesn't have a builtin to do this :/
Diffstat (limited to 'backend/decky_loader/plugin/sandboxed_plugin.py')
-rw-r--r--backend/decky_loader/plugin/sandboxed_plugin.py4
1 files changed, 4 insertions, 0 deletions
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