From bf955cf5970700a67225ed40560da3f290533b3d Mon Sep 17 00:00:00 2001 From: YouLikeCats Date: Sat, 8 Nov 2025 21:17:06 -0500 Subject: [PATCH] added OS-specific start command in start.m file --- +discordrpc/start.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/+discordrpc/start.m b/+discordrpc/start.m index cccf482..7c2d8e3 100644 --- a/+discordrpc/start.m +++ b/+discordrpc/start.m @@ -72,9 +72,17 @@ function start() return; end - % Launch Python script in background using nohup to ensure persistence + % Launch Python script in background using start command (operating system specific) to ensure persistence % Redirect output to /dev/null - command = sprintf('nohup "%s" "%s" "%s" "%s" > /dev/null 2>&1 &', pythonExecutable, pythonScriptPath, commFilePath, currentFile); + if ispc + command = sprintf('start /B "DiscordRPC" "%s" "%s" "%s" "%s" > NUL 2>&1', pythonExecutable, pythonScriptPath, commFilePath, currentFile); + elseif isunix + command = sprintf('nohup "%s" "%s" "%s" "%s" > /dev/null 2>&1 &', pythonExecutable, pythonScriptPath, commFilePath, currentFile); + elseif ismac + command = sprintf('open "%s" "%s" "%s" "%s" > /dev/null 2>&1 &', pythonExecutable, pythonScriptPath, commFilePath, currentFile); % not sure if this works on mac...yet to test + else + error('Unsupported operating system for launching Python script.'); + end [status, cmdout] = system(command); % Launch command if status ~= 0