mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2025-12-06 07:12:01 +01:00
30 lines
772 B
C#
30 lines
772 B
C#
using System.Diagnostics;
|
|
|
|
namespace SteamController.Managers
|
|
{
|
|
public sealed class ProcessManager : Manager
|
|
{
|
|
public static readonly String[] ActivationProcessNames = new String[]
|
|
{
|
|
"Playnite.FullscreenApp"
|
|
};
|
|
|
|
private Process? FindActivationProcess()
|
|
{
|
|
foreach (var processName in ActivationProcessNames)
|
|
{
|
|
var process = Process.GetProcessesByName(processName).FirstOrDefault();
|
|
if (process is not null)
|
|
return process;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public override void Tick(Context context)
|
|
{
|
|
context.State.GameProcessRunning = FindActivationProcess() is not null;
|
|
}
|
|
}
|
|
}
|