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

Issue with libraryfolders.vdf #24

Closed yochananmarqos closed 2 years ago

yochananmarqos commented 2 years ago

My libraryfolders.vdf is in ~/.steam/steam/steamapps/, but it's looking for it in /.steam/steam/config/ instead.

❯ sif --verbose
Working with Papirus-Dark icon theme.

[ok] Found Steam installation directory:
   - /home/yochanan/.steam/steam

[ok] Found Steam configuration file:
   - /home/yochanan/.steam/steam/config/config.vdf

Traceback (most recent call last):
  File "/usr/bin/sif", line 349, in <module>
    library_folders = get_steam_libraries()
  File "/usr/bin/sif", line 59, in get_steam_libraries
    libraries_config = vdf.load(open(STEAM_INSTALL_DIR + '/config/libraryfolders.vdf'))
FileNotFoundError: [Errno 2] No such file or directory: '/home/yochanan/.steam/steam/config/libraryfolders.vdf'

I symlinked it to ~/.steam/steam/config/, but it doesn't seem to like my file:

Working with Papirus-Dark icon theme.

[ok] Found Steam installation directory:
   - /home/yochanan/.steam/steam

[ok] Found Steam configuration file:
   - /home/yochanan/.steam/steam/config/config.vdf

Traceback (most recent call last):
  File "/usr/bin/sif", line 349, in <module>
    library_folders = get_steam_libraries()
  File "/usr/bin/sif", line 61, in get_steam_libraries
    for library in libraries_config['libraryfolders'].values():
KeyError: 'libraryfolders'

My libraryfolders.vdf:

"LibraryFolders"
{
    "TimeNextStatsReport"       "1623265925"
    "ContentStatsID"        "3289963266067000499"
    "1"     "/mnt/storage/Games/steam"
}

Manjaro GNOME sif-git r101.f3354aa-1 steam-manjaro 1.0.0.71-1 steam-native 1.0.0.70-2

BlueManCZ commented 2 years ago

Hello, thank you for reporting this!

It's very strange. I just tested it on Manjaro and Gentoo and I have both files ~/.steam/steam/config/libraryfolders.vdf and ~/.steam/steam/steamapps/libraryfolders.vdf and they are exactly the same. But both for some reason use different syntax than your file does.

My libraryfolders.vdf file:

"libraryfolders"
{
    "contentstatsid"        "-7679687468067839144"
    "1"
    {
        "path"      "/media/ivo/manjarohome/home/ivo/.local/share/Steam"
        "label"     ""
        "contentid"     "7328791404652866639"
        "totalsize"     "40958427136"
        "apps"
        {
        }
    }
    "2"
    {
        "path"      "/media/ivo/storage/SteamLibrary"
        "label"     ""
        "contentid"     "4489297710320386189"
        "totalsize"     "206613708800"
        "apps"
        {
            "8870"      "18104795465"
            # shortened
        }
    }
    "3"
    {
        "path"      "/media/ivo/ssd-storage/SteamLibrary"
        "label"     ""
        "contentid"     "971097219502658197"
        "totalsize"     "622768160768"
        "apps"
        {
            "220"       "3766825842"
            # shortened
        }
    }
}

Are you subscribed to Steam beta program? For me, SIF works fine with both, but I would really like to know if that changes anything for you. It's just a few clicks in Steam settings and you can unsubscribe anytime.

obrazek

The main question is, if this problem is only some kind of anomaly on your local Steam installation or it can affect more users and I should implement some sort of patch to distinguish two types of libraryfolders.vdf.

BlueManCZ commented 2 years ago

I made some fixes so the script should no longer crash with an exception for you, but in its current state, it will not detect any games in your "/mnt/storage/Games/steam" library, if you have any installed.

yochananmarqos commented 2 years ago

Are you subscribed to Steam beta program?

Nope.

it will not detect any games in your "/mnt/storage/Games/steam" library

That's where all my games are installed.

❯ sif --verbose
Working with Papirus-Dark icon theme.

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

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

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

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

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

[ok] Found wm-class-database file:
   - /opt/sif/database.json

No games found to fix.
BlueManCZ commented 2 years ago

This SIF output is with Steam beta? I see it found config/libraryfolders.vdf. Or I guess it's just a symlink you made? You can remove the symlink. Can you provide content of libraryfolders.vdf file with Steam beta? I guess it changed.

yochananmarqos commented 2 years ago

As I said I am not using Steam beta. Yes, that was the symlink I made.

BlueManCZ commented 2 years ago

And can you try Steam beta? As I said, you can anytime come back to Steam stable.

BlueManCZ commented 2 years ago

https://github.com/BlueManCZ/SIF/commit/6ae77edc8a14fa1ce533164a0099785755036d9c Alright, it should work now for you even without Steam beta. Can you test it, please?

yochananmarqos commented 2 years ago

It's working now, thanks.

❯ sif --icons
These icons for your installed Steam games were found in Papirus-Dark icon theme:

  Borderlands: The Pre-Sequel - /usr/share/icons/Papirus-Dark/48x48/categories/steam_icon_261640.svg
  Skyrim Script Extender (SKSE) - /usr/share/icons/Papirus-Dark/48x48/categories/steam_icon_365720.svg
* The Elder Scrolls V: Skyrim Special Edition - /usr/share/icons/Papirus-Dark/48x48/categories/steam_icon_489830.svg

* - game is in our database and can be fixed
~ - game is fixable, but we have to edit its launch options
❯ sif --verbose
Working with Papirus-Dark icon theme.

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

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

[ok] Found Steam libraryfolders.vdf file:
   - /home/yochanan/.local/share/Steam/steamapps/libraryfolders.vdf

[ok] Found Steam library folders:
   - /home/yochanan/.local/share/Steam/steamapps
   - /mnt/storage/Games/steam/steamapps

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

[ok] Found wm-class-database file:
   - /opt/sif/database.json

[!!] Creating target directory.
[ok] Successfully created the directory:
   - /home/yochanan/.local/share/applications/steam-icons-fixed
Creating .desktop files in /home/yochanan/.local/share/applications/steam-icons-fixed

 489830   - The Elder Scrolls V: Skyrim Special Edition (/home/yochanan/.local/share/applications/steam-icons-fixed/The-Elder-Scrolls-V:-Skyrim-Special-Edition.desktop)
BlueManCZ commented 2 years ago

Nice. Would you mind sharing WM_CLASS of Borderlands: The Pre-Sequel to the database?

yochananmarqos commented 2 years ago

It appears the WM_CLASS is just the Steam game ID, right? It's 261640. However, there's nothing to fix with that game.

BlueManCZ commented 2 years ago

It appears the WM_CLASS is just the Steam game ID, right?

I don't know, I don't own the game. If xprop WM_CLASS returns only the game ID, then it's only the game ID. Can you confirm this?

However, there's nothing to fix with that game.

What do you mean? I guess it doesn't use a Papirus icon as default runtime icon, or does it?

yochananmarqos commented 2 years ago

It's BorderlandsPreSequel, turns out.

The Papirus icon is already used, SIF isn't necessary. Nothing to fix.

BlueManCZ commented 2 years ago

Alright, interesting. Thank you.