gnome-games
gnome-games copied to clipboard
Track running Steam games
Steam games are currently the only games which never "stop" and hence which never come back to the collection when the game ends.
Tracking their state would allow to go back to the collection when the game ends and maybe more in the future.
Steam run its games in a SteamChildMonit process. The /proc directory can be monitored to track the spawning processes. The process' name and parent can be retrieved from /proc/PID/stat and the its command line can be retrieved from /proc/PID/cmdline.
Solution 1:
- a game's process is the one whose parent is named
SteamChildMonitand whose command line contains comething like*/SteamApps/common/GAME_NAME/*. - problem: the name of the game must match the directory name.
Solution 2:
- a game's process is the one named
SteamChildMonitand which appeared just after the command to run it started.