Documentation
¶
Index ¶
- Constants
- func DesktopSessionEnvOverrides(gameMode *gamescope.Manager) []string
- func IsDesktopSessionEnvKey(key string) bool
- func ParseDesktopSessionEnv(output string) []string
- func Settings() platforms.Settings
- func SupportedReaders(cfg *config.Instance, p platforms.Platform) []readers.Reader
- type Base
- func (b *Base) ClearTrackedProcessMedia(proc *os.Process) bool
- func (b *Base) ClearTrackedProcessPID(pid int) bool
- func (*Base) ConsoleManager() platforms.ConsoleManager
- func (*Base) ForwardCmd(_ *platforms.CmdEnv) (platforms.CmdResult, error)
- func (*Base) GamepadPress(_ string) error
- func (b *Base) ID() string
- func (*Base) KeyboardPress(_ string) error
- func (b *Base) LaunchMedia(cfg *config.Instance, path string, launcher *platforms.Launcher, ...) error
- func (*Base) LaunchSystem(_ *config.Instance, _ string) error
- func (*Base) LookupMapping(_ *tokens.Token) (string, bool)
- func (*Base) ManagedByPackageManager() bool
- func (*Base) ReturnToMenu() error
- func (*Base) RootDirs(cfg *config.Instance) []string
- func (*Base) ScanHook(_ *tokens.Token) error
- func (*Base) Scrapers(_ *config.Instance) map[string]platforms.Scraper
- func (*Base) Screenshot() (*platforms.ScreenshotResult, error)
- func (b *Base) SetClock(clock clockwork.Clock)
- func (b *Base) SetTrackedProcess(proc *os.Process)
- func (b *Base) StartPost(ctx context.Context, _ *config.Instance, ...) error
- func (*Base) StartPre(_ *config.Instance) error
- func (*Base) Stop() error
- func (b *Base) StopActiveLauncher(_ platforms.StopIntent) error
- func (b *Base) WaitTrackedProcess(proc *os.Process) error
Constants ¶
const ( // CustomKillTimeout is how long to wait for launcher-specific graceful shutdown. CustomKillTimeout = 500 * time.Millisecond // SIGTERMTimeout is how long to wait for graceful SIGTERM shutdown. SIGTERMTimeout = 3 * time.Second // SIGKILLTimeout is how long to wait after SIGKILL before proceeding. SIGKILLTimeout = 500 * time.Millisecond )
Timeout constants for process termination.
Variables ¶
This section is empty.
Functions ¶
func DesktopSessionEnvOverrides ¶
DesktopSessionEnvOverrides returns GUI and user-directory variables for the active desktop session. This prevents service-specific XDG paths from leaking into launched applications. A detected gamescope display takes precedence.
func IsDesktopSessionEnvKey ¶
IsDesktopSessionEnvKey reports whether key belongs to the active GUI session.
func ParseDesktopSessionEnv ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base provides common functionality for all Linux-family platforms. Platforms embed this struct and override methods as needed.
func (*Base) ClearTrackedProcessMedia ¶ added in v2.16.0
ClearTrackedProcessMedia clears active media only if proc completed without a newer process being tracked. This prevents an old process waiter from clearing the active media published by a replacement launch.
func (*Base) ClearTrackedProcessPID ¶ added in v2.16.0
ClearTrackedProcessPID forgets a completed externally-owned process without signaling it. The PID check prevents an older lifecycle event from clearing a newer tracked process.
func (*Base) ConsoleManager ¶
func (*Base) ConsoleManager() platforms.ConsoleManager
ConsoleManager returns a no-op console manager.
func (*Base) ForwardCmd ¶
ForwardCmd is not supported on generic Linux platforms (no command forwarding).
func (*Base) GamepadPress ¶
GamepadPress is a no-op for Linux platforms.
func (*Base) KeyboardPress ¶
KeyboardPress is a no-op for Linux platforms.
func (*Base) LaunchMedia ¶
func (b *Base) LaunchMedia( cfg *config.Instance, path string, launcher *platforms.Launcher, db *database.Database, opts *platforms.LaunchOptions, p platforms.Platform, ) error
LaunchMedia launches media using the appropriate launcher. The platform parameter is required to access the platform's Launchers method (struct embedding means Base cannot call methods defined on the outer type).
func (*Base) LaunchSystem ¶
LaunchSystem returns an error as launching systems is not supported.
func (*Base) LookupMapping ¶
LookupMapping returns false (no token mappings on Linux platforms).
func (*Base) ManagedByPackageManager ¶ added in v2.10.0
ManagedByPackageManager returns false. Platforms that embed Base and have package manager detection should override this method.
func (*Base) ReturnToMenu ¶
ReturnToMenu is a no-op for the base Linux implementation. Platforms with a menu concept (like SteamOS) should override this method.
func (*Base) Scrapers ¶ added in v2.12.0
Scrapers returns the default set of metadata scrapers for Linux-based platforms.
func (*Base) Screenshot ¶ added in v2.10.0
func (*Base) Screenshot() (*platforms.ScreenshotResult, error)
Screenshot is not supported on generic Linux platforms.
func (*Base) SetTrackedProcess ¶
SetTrackedProcess stores a process handle, killing any existing tracked process.
func (*Base) StartPost ¶
func (b *Base) StartPost( ctx context.Context, _ *config.Instance, launcherManager platforms.LauncherContextManager, activeMedia func() *models.ActiveMedia, setActiveMedia func(*models.ActiveMedia), _ *database.Database, _ *idle.Scheduler, ) error
StartPost initializes the platform after service startup.
func (*Base) StopActiveLauncher ¶
func (b *Base) StopActiveLauncher(_ platforms.StopIntent) error
StopActiveLauncher runs launcher-specific shutdown, stops any tracked process tree, and clears active media. Tracked processes receive SIGTERM and SIGKILL fallback.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gamescope makes externally launched windows visible and focused in gamescope Gaming Mode sessions.
|
Package gamescope makes externally launched windows visible and focused in gamescope Gaming Mode sessions. |
|
Package procscanner provides a shared process scanner for monitoring multiple types of processes with a single /proc scan.
|
Package procscanner provides a shared process scanner for monitoring multiple types of processes with a single /proc scan. |
|
Package proctracker provides process exit tracking using pidfd_open on Linux 5.3+.
|
Package proctracker provides process exit tracking using pidfd_open on Linux 5.3+. |