mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-18 22:50:14 +01:00
- This makes to autmatically swittch to controller when Playnite Fullscreen is in use. - This makes to automatically disable when Steam is in Big Picture or running Game - Indicate current status with well distinguishable icons - Expose all options via Context Menu
53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
using System.Diagnostics;
|
|
|
|
namespace SteamController.Profiles
|
|
{
|
|
public sealed class ProcessProfile : Profile
|
|
{
|
|
public static readonly String[] ActivationProcessNames = new String[]
|
|
{
|
|
"Playnite.FullscreenApp"
|
|
};
|
|
|
|
private bool activated;
|
|
|
|
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)
|
|
{
|
|
// React to state change
|
|
if (FindActivationProcess() is not null)
|
|
{
|
|
if (!activated)
|
|
{
|
|
activated = true;
|
|
context.RequestDesktopMode = false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (activated)
|
|
{
|
|
activated = false;
|
|
context.RequestDesktopMode = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override Status Run(Context context)
|
|
{
|
|
return Status.Continue;
|
|
}
|
|
}
|
|
}
|