Track idle by input #18
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently dgamelaunch checks the mtime of the ttyrec to determine idle time of games for the watching games menu.
Some games continue to update the screen while the user is idle (e.g. NetHack-setseed with realtime UI-clock enabled on the status bar), which results in idle games being displayed as active.
This PR introduces an additional file in the inprogressdir, which is the same as the lockfile path but with '.in' appended.
Any user input is copied live to this file.
The watch menu checks the mtime of this file instead, to show the idle timer for a given game.
Additional routines were implemented to clean up this extra file, and to exclude it from being treated as a lockfile.
This is because currently all files in inprogressdir are treated as lockfiles. With this PR, those ending in '.in' are excluded, and also removed if they are orphans (if the same file without the '.in' suffix does not exist, they are considered orphans).