ChimeraOS / ChimeraOS/chimera

[Suggestion] Make steam-buddy manage Steam games

Open
#11 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
286
Forks
34
PR merge metrics
No merged PRs in 30d

Description

# Introduction

Kind of obvious, you probably already came up with this idea. I was thinking steam-buddy could be used to install and uninstall steam games and restart steam to apply shortcuts. It could also show your library in a nice overview.

I've done a bit of research into what we'll need to be able to offer this.

# Useful files

I've found that the following files contain information we'd need:
- ``~/.steam/steam/userdata/*/config/localconfig.vdf`` contains all the games the user owns under "Software" -> "Valve" -> "Steam" -> "Apps". It only contains the steam app id, playtime in minutes and when the game was last played.
- ``~/.steam/steam/config/loginusers.vdf`` contains all the users who have logged in to the system and their account name. This could be useful if we'd want to connect up with any APIs.
- ``~/.steam/registry.vdf`` contains all currently installed games and if they are currently updating. It will also show games as updating if they are currently being installed. It includes names, but not for everything that is installed.
- The ``~/.steam/steam/config/avatarcache`` directory contains the avatar of the user, which is a png file.

# Missing pieces

The information found in these files is almost enough to show everything we need. The only things missing are names for games and thumbnails. Valve has an API which can gives a list of all application names, which can be found [here](https://api.steampowered.com/ISteamApps/GetAppList/v2/). For the thumbnails we can probably use the thumbnails from Steam which are already being cached by steam-tweaks.

# Controlling Steam

Now the final missing piece is how we could manage Steam. This can be done with by sending commands to steam from the command line as the user which is currently running steam. I found this out by looking at the steamkillall.sh script in SteamOS ~~which makes Steam kill itself (and restart, because lightdm will restart it). We could use this as well:~~
```bash
#!/bin/sh

touch /tmp/hkkillfile
steam steam://hkkillall

```
Edit: Steam doesn't respond to this script anymore, so instead we now just use the ``pkill`` command to stop Steam.

Installing applicaitons can be done in a similar way by running ``steam steam://install/730`` for CS:GO for instance. Uninstalling would be done with ``steam steam://uninstall/730``. In steam big picture mode steam asks no questions when doing this, unlike in desktop mode. Applications can also be started with ``steam steam://run/730``, but this might not be as useful. 730 can of course be replaced by any stream app id.

# Closing comments

Sorry if this is a long post. We should probably discuss this before trying to implement it, but I wanted to make sure I had what I found written down somewhere we can use it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the listed Steam data files, especially localconfig.vdf, registry.vdf, and loginusers.vdf, along with the Steam App List API referenced in the issue. Then investigate the documented steam:// commands and the pkill approach for controlling Steam. Done would require an agreed scope and working support for library display and game installation, uninstallation, or restart management.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.