mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-04 22:07:40 +00:00
Introduce inheritable Profiles and Managers
- There's always a single Profile choosen - There are many Managers changing settings depending on environment - Improve and re-use mappings between profiles - Introduce Steam Profile to be used when in Steam Big Picture or Steam Game
This commit is contained in:
parent
10d6c055da
commit
ab5bc370df
21 changed files with 530 additions and 311 deletions
47
SteamController/Managers/ProcessManager.cs
Normal file
47
SteamController/Managers/ProcessManager.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System.Diagnostics;
|
||||
|
||||
namespace SteamController.Managers
|
||||
{
|
||||
public sealed class ProcessManager : Manager
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue