BlueManCZ / SIF

:video_game: Steam Icons Fixer - Fix runtime icons of Steam games on Linux.
Apache License 2.0
46 stars 3 forks source link

Cannot Run Successfully #28

Closed FeyXieXzf closed 1 year ago

FeyXieXzf commented 1 year ago

Installed from AUR. Log below.

$ ./sif.py --pretend --verbose
Current icon theme: Papirus-Light

Steam version: steam-runtime_0.20220315.0

[ok] Found Steam installation directory:
   - /home/ujhhgtg/.local/share/Steam

[ok] Found Steam configuration file:
   - /home/ujhhgtg/.local/share/Steam/config/config.vdf

[ok] Found Steam libraryfolders.vdf file:
   - /home/ujhhgtg/.local/share/Steam/config/libraryfolders.vdf

[ok] Found Steam library folders:
   - /home/ujhhgtg/.local/share/Steam/steamapps

[ok] Found Steam localconfig.vdf file:
   - /home/ujhhgtg/.local/share/Steam/userdata/1123682541/config/localconfig.vdf

[ok] Found database.json file:
   - /usr/share/SIF/database.json

Traceback (most recent call last):
  File "/usr/bin/sif", line 561, in <module>
    if any(x in games_with_compat[str(game)]["name"] for x in ["proton", "Proton"]):
  File "/usr/bin/sif", line 561, in <genexpr>
    if any(x in games_with_compat[str(game)]["name"] for x in ["proton", "Proton"]):
KeyError: 'name'

Installed steam games: Superliminal(native), Among Us(Steam Play: Proton Experimental), Bridge Constructor Portal(native)

BlueManCZ commented 1 year ago

Hello, thank you for reporting this! I'm curious how the contents of ~/.local/share/Steam/config/config.vdf file look in your case. Not necessarily the whole file, but the "CompatToolMapping" section is what I'm interested in. In my case, it contains entries for all games I manually configured to use a specific version of Proton. So it looks like this:

"CompatToolMapping"
{
    "0"
    {
        "name"      "proton_7"
        "config"        ""
        "priority"      "75"
    }
    "271590"
    {
        "name"      "GE-Proton7-25"
        "config"        ""
        "priority"      "250"
    }
    "244850"
    {
        "name"      "GE-Proton7-26"
        "config"        ""
        "priority"      "250"
    }
    ... (shortened)
}

From your report, it seems that the "name" attribute is missing in some (maybe all) entries. Maybe Steam introduced some new format for this section and I would need to adapt this script to it. But this is probably not the case, because in your log I can see you use six months old Steam version steam-runtime_0.20220315.0.

Anyway, it doesn't happen in my case, so I don't really have a way to debug this. I will be glad for your cooperation.

FeyXieXzf commented 1 year ago

I found the error and also the solution. The "name" key below the "CompatToolMapping" should be "Name". Looks like #18 very much lol. I changed line 561 from:

        if any(x in games_with_compat[str(game)]["name"] for x in ["proton", "Proton"]):

to:

    for game in games_with_compat:
        if any(x in games_with_compat[str(game)]["Name"] for x in ["proton", "Proton"]):

and everything works perfectly.

BlueManCZ commented 1 year ago

Thank you for testing this. It should be fixed in the latest master commit.

https://github.com/BlueManCZ/SIF/blob/9aada9ad2f4817a42867e6a31862b5f034d86481/sif.py#L583

You are right, it looks very similar to the issue you mentioned. I have no idea how Steam generates those files and which naming convention they use. Could you please test, if the latest version works for you?

FeyXieXzf commented 1 year ago

Thank you! Seems like it's fixed.

FeyXieXzf commented 1 year ago

I looked at my config and i found the reason. "name" need to be "Name". That looks like #18 much. "CompatToolMapping" { "0" { "Name" "proton_experimental" "config" "" "priority" "75" } } btw, my steam-runtime shouldn't be out-of-date (I think) , i use arch and it's uptodate.

On Sun, Sep 18 2022 at 02:40:15 AM -07:00:00, Ivo Šmerek @.***> wrote:

Hello, thank you for reporting this! I'm curious how the contents of ~/.local/share/Steam/config/config.vdf file look in your case. Not necessarily the whole file, but the "CompatToolMapping" section is what I'm interested in. In my case, it contains entries for all games I manually configured to use a specific version of Proton. So it looks like this:

"CompatToolMapping" { "0" { "name" "proton_7" "config" "" "priority" "75" } "271590" { "name" "GE-Proton7-25" "config" "" "priority" "250" } "244850" { "name" "GE-Proton7-26" "config" "" "priority" "250" } ... (shortened) } From your report, it seems that the "name" attribute is missing in some (maybe all) entries. Maybe Steam introduced some new format for this section and I would need to adapt this script to it. But this is probably not the case, because in your log I can see you use six months old Steam version steam-runtime_0.20220315.0.

Anyway, it doesn't happen in my case, so I don't really have a way to debug this. I will be glad for your cooperation.

— Reply to this email directly, view it on GitHub https://github.com/BlueManCZ/SIF/issues/28#issuecomment-1250231097, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUHU6YJ7UKXXQRHPF2EP7DV63PP7ANCNFSM6AAAAAAQPJ3I7A. You are receiving this because you authored the thread.Message ID: @.***>