Repository navigation
Expand file tree
/
Copy pathconfig.example.toml
More file actions
147 lines (132 loc) · 6.45 KB
/
Copy pathconfig.example.toml
File metadata and controls
147 lines (132 loc) · 6.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# GameModeExecutor - example configuration
#
# Copy this file next to gamemode-executor.exe as `config.toml`,
# or run `gamemode-executor init` to drop it in %APPDATA%\GameModeExecutor.
#
# There is no list of games to maintain here. Detection is Windows' own: the
# program watches the Game Bar presence writer, which Windows starts for a game
# and releases when it is gone -- and, for a game Windows did not recognise and
# you marked with "Remember this is a game" in the Game Bar, the game itself.
#
# Paths are easiest written between single quotes: TOML takes those literally,
# so Windows separators need no doubling.
#
# `gamemode-executor validate` checks this file and points at the line and
# column of anything wrong.
# ---------------------------------------------------------------------------
[general]
# ---------------------------------------------------------------------------
# Run the on_game_stop actions when the watcher itself exits while a game is
# running. A logoff or shutdown cannot run them in time -- Windows refuses to
# start a program once the session is ending -- so they run at the next logon
# instead, from a marker file the watcher keeps in %LOCALAPPDATA%\GameModeExecutor.
stop_actions_on_exit = true
# error | warn | info | debug | trace. The RUST_LOG environment variable
# overrides this when set.
#
# This is the dial between two readers of the same log.
#
# At "info" it stays on what this program is for: a game detected, named or
# gone, and the watcher starting or stopping. Nothing else competes with those
# lines.
#
# At "debug" you get that same log annotated -- process ids, paths, error codes
# attached to each line -- plus why the program did what it did: when Windows
# released the presence writer and whether the game had already exited by then,
# why a refinement declined to rename anything. A handful of extra lines per
# session.
#
# Run in a terminal rather than hidden and the same lines appear there too,
# identical to the file and coloured when the terminal is a real one. See
# "The log" in docs/reference.md.
log_level = "info"
# Where the log files go. Defaults to %LOCALAPPDATA%\GameModeExecutor\logs --
# Local rather than Roaming, because a log describes one machine's sessions and
# has no business following you to another.
# One file a day, gamemode-executor.YYYY-MM-DD.log. The day changes at midnight
# UTC, not at your midnight; every line keeps its local time.
#log_dir = 'C:\Users\me\AppData\Roaming\GameModeExecutor\logs'
# How many days of log to keep, today's included; the oldest files go. A whole
# number, 1 or more. Without this line, 7. Like log_dir, a change applies at
# the next start.
#log_days = 7
# ---------------------------------------------------------------------------
[detection]
# ---------------------------------------------------------------------------
# How often to look for a game while none is running: the presence writer, or
# a game you marked by hand. This is the only polling the program does, and a
# look costs a few hundredths of a millisecond; once a game starts it parks on
# the process's handle and does nothing until it ends.
poll_interval = "2s"
# After the writer exits, how long to wait for it to come back before running
# the stop actions. Guards against a game that briefly makes Windows
# re-activate it. Set to "0s" to react immediately.
stop_delay = "2s"
# A title brings several processes that all match Windows' known game list: a
# launcher stub, an anti-cheat service, and the game. The satellites usually
# start first, so the name captured at the very start is often the wrong one.
# This far into a session, the per-process GPU counters are read and the
# candidate that is actually rendering wins. While there is no answer yet --
# nothing rendering, no match -- they are read again at the same interval, six
# attempts in all. Set to "0s" to skip it and keep whichever process matched
# first.
#
# This only ever changes the *name*: detection never depends on it, and being
# unable to read the counters simply means no answer.
identify_after = "20s"
# GPU utilisation is a rate, so it needs two readings this far apart.
gpu_sample = "1s"
# ---------------------------------------------------------------------------
# Actions
#
# Each event has a mode and a list of commands:
#
# mode = "series" each command runs after the previous one has been
# waited for. This is the default.
# mode = "parallel" all commands are started at once, then waited for.
#
# A command that fails to start is logged and never prevents the others from
# running.
#
# Every command accepts:
#
# name label used in the log; defaults to the program path
# program the executable to run; a name alone is looked for in the
# system folder, the Windows folder, then PATH, never beside
# this program
# args its arguments, one string per argument
# working_dir directory to run it from
# env extra environment variables, as key = "value"
# no_window hide the console window of the child process (default true)
# wait wait for it to finish (default false)
# timeout give up waiting after this long; ignored unless `wait`
# enabled set to false to keep a command without running it
#
# These placeholders are substituted in program, args, working_dir and env:
#
# {event} game_start or game_stop
# {process_name} e.g. FarmingSimulator2025Game.exe
# {process_id} e.g. 12345
# {process_path} full path, when readable
#
# They are filled from Windows' known game list and are best effort: a title
# Windows tracks but does not describe leaves them empty. Detection still
# works, only the naming is missing.
# ---------------------------------------------------------------------------
[on_game_start]
mode = "series"
# Nothing runs until you say so: as written, this file makes the watcher
# detect and log sessions and do nothing else, which is a fine way to see it
# work first. To *hear* it work, uncomment the two commands below -- a rising
# beep when a game starts, a falling one when it ends -- then look at
# docs/recipes/ for real ones: fan profiles, a power plan.
#[[on_game_start.actions]]
#name = "beep"
#program = "powershell.exe"
#args = ["-NoProfile", "-Command", "[console]::Beep(880,120); [console]::Beep(1320,180)"]
[on_game_stop]
mode = "series"
#[[on_game_stop.actions]]
#name = "beep"
#program = "powershell.exe"
#args = ["-NoProfile", "-Command", "[console]::Beep(1320,120); [console]::Beep(880,180)"]