ntcarlson / dotfiles

139 stars 16 forks source link

Multiple game libraries #3

Open fubarhouse opened 3 years ago

fubarhouse commented 3 years ago

Seems you support only one path here, any chance you'll add support for multiple - ie csv / $PATH-like stuff?

For cases where multiple steam libraries are used, multiple storage devices etc?

Example

$DIRS=/"home/user/library1:/home/user/library2:/mnt/media/drive1/games:/mnt/media/drive2/games";

https://github.com/ntcarlson/dotfiles/blob/delta/config/rofi/scripts/update-game-entries.sh#L16

ntcarlson commented 3 years ago

If I understand your issue correctly, the update-game-entries.sh should already handle that case. Steam records additional libraries you add into <steam root>/steamapps/libraryfolders.vdf and the script (crudely) parses that. In your case, libraryfolders.vdf would look something like

"libraryfolders"
{
    . . . .
    "1"     "/home/user/library1"
    "2"     "/home/user/library2"
    "3"     "/mnt/media/drive1/games"
    "4"     "/mnt/media/drive2/games"
}

By parsing this file, it shouldn't be necessary to manually specify the additional libraries.

Sebiann commented 3 years ago

my libraryfolders.vdf looks like this.

"libraryfolders"
{
    "contentstatsid"        "6598681657945936670"
    "1"
    {
        "path"      "/home/sebastian/lsomedisk/SteamLibrary"
        "label"     ""
        "contentid"     "7311696120619488124"
        "totalsize"     "3936159326208"
        "apps"
        {
            "620"       "12718399062"
            "35140"     "8471095333"
            "105600"        "693931009"
            "109600"        "241324041"
            "200260"        "19948606783"
            "208650"        "57739548189"
            "209000"        "19593363918"
        }
    }
}

so when i try to open rofi it shows this in the console:

awk: fatal: cannot open file `111747562/steamapps/appmanifest_*.acf' for reading: No such file or directory
awk: fatal: cannot open file `69803527865/steamapps/appmanifest_*.acf' for reading: No such file or directory
awk: fatal: cannot open file `952962515/steamapps/appmanifest_*.acf' for reading: No such file or directory
awk: fatal: cannot open file `127921340/steamapps/appmanifest_*.acf' for reading: No such file or directory
awk: fatal: cannot open file `349437708/steamapps/appmanifest_*.acf' for reading: No such file or directory
ntcarlson commented 3 years ago

That's quite strange. I can't find any public documentation about the format of libraryfolders.vdf, but every other example I have seen just uses the much more basic format in my earlier comment. I'll look into making the parsing more robust.

For now as a workaround, you can modify the steam-libraries() function in scripts/update-game-entries.sh to just output your hard-coded library paths. E.g. change it to

steam-libraries() {
    echo "$STEAM_ROOT"
    echo $HOME/lsomedisk/SteamLibrary
}
Sebiann commented 3 years ago

thx. that worked.

murlakatamenka commented 2 years ago

I can't find any public documentation about the format of

Here it is: https://developer.valvesoftware.com/wiki/KeyValues

There are multiple libraries to work with it, for example, Python's https://github.com/ValvePython/vdf