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

Proton game doesn't use the system-provided icon #39

Closed Tiagoquix closed 4 months ago

Tiagoquix commented 4 months ago

I'm playing https://store.steampowered.com/app/787480/Phoenix_Wright_Ace_Attorney_Trilogy/, which runs through Proton, but it uses its default .exe icon instead of the system-provided icon.

By the way, I'm using the latest version of Proton-GE, but I don't think this causes any problems related to the icons.

Thanks in advance.

Tiagoquix commented 4 months ago

To clarify, the game shows up on the ./sif.py --games output, but doesn't on the ./sif.py --pretend.

Using Papirus icon theme.

Tiagoquix commented 4 months ago

I'm trying to fix the game by manually adding the WM_NAME to the databases.json file. Not adding the WM_CLASS because it's running through Proton, so it's not necessary.

I think it would work, since it showed up with the --pretend option. However, I wasn't able to test it due to its WM_NAME value.

For the original game (which you download from Steam):

WM_CLASS(STRING) = "steam_app_787480", "steam_app_787480"
WM_NAME(COMPOUND_TEXT) = "Phoenix Wright: Ace Attorney Trilogy / 逆転裁判123 成歩堂セレクション"

For a fan translation of the game that I use (which changes the WM_NAME):

WM_CLASS(STRING) = "steam_app_787480", "steam_app_787480"
WM_NAME(STRING) = "Advogados de Primeira - A Trilogia"

(It's a Brazilian Portuguese fan-made translation from https://jacutemsabao.bitbucket.io/.)

It's not working, but this is not due to the script itself; rather, it is my lack of knowledge of JSON formatting.

I tried to escape the Japanese characters

"787480": ["Phoenix Wright: Ace Attorney Trilogy \/ \u9006\u8EE2\u88C1\u5224123 \u6210\u6B69\u5802\u30BB\u30EC\u30AF\u30B7\u30E7\u30F3", "Advogados de Primeira - A Trilogia"],

but the script gives me errors and doesn't proceed.

BlueManCZ commented 4 months ago

If the game has a unique WM_CLASS, which in this case it does, you don't need WM_NAME. You just add

"787480": "steam_app_787480",

to the "wm_classes" section in the database.json.

However, the script should automatically detect Proton games (if you indeed selected custom Proton in the dropdown menu in games properties / compatibility). I added a custom log for this in latest commit.

Can you update and share the output of ./sif.py --verbose? Can you share the output of ./sif.py --icons as well?

Tiagoquix commented 4 months ago

If the game has a unique WM_CLASS, which in this case it does, you don't need WM_NAME. You just add

"787480": "steam_app_787480",

to the "wm_classes" section in the database.json.

Isn't the procedure the opposite of that? According to this, the script automatically knows the WM_CLASS of games that are running via Proton. So, as far as I understand, we would need the WM_NAME of the game, and not WM_CLASS since it is already known.

However, the script should automatically detect Proton games (if you indeed selected custom Proton in the dropdown menu in games properties / compatibility). I added a custom log for this in latest commit.

Can you update and share the output of ./sif.py --verbose? Can you share the output of ./sif.py --icons as well?

Here are the outputs after running ./sif.py --restore: https://0.jaegers.net/?d597307f8fe4eb80#5o7pWAv1zD29F9pF3xFxsZLzG3bH1wjn263DogYuA1Zk

The game probably wasn't detected in verbose mode because I don't necessarily activate Proton in the game properties. I set my custom Proton-GE version as the global default and leave the game-specific option unchecked.

BlueManCZ commented 4 months ago

Thank you for the outputs.

The game probably wasn't detected in verbose mode because I don't necessarily activate Proton in the game properties. I set my custom Proton-GE version as the global default and leave the game-specific option unchecked.

This is currently not supported by the script (And I will need to update the documentation for this or somehow fix it).

What is supported tho, is if you set the Proton version for the specific game. Right-click on the game in the library > ...Properties > Compatibility > Force the use of a specific Steam Play compatibility tool, select the Proton version and then run the SIF script again. You can then return the settings to your previous, the icon should stay fixed as long as you don't run the script with --restore or --clean flags.

This is because SIF script looks for Proton-specific games in the ~/.local/share/Steam/config/config.vdf file in the section CompatToolMaping and those mappings are necessary to be configured per game for the script to find them.

Isn't the procedure the opposite of that? According to this, the script automatically knows the WM_CLASS of games that are running via Proton. So, as far as I understand, we would need the WM_NAME of the game, and not WM_CLASS since it is already known.

This works only if the script finds the game in CompatToolMaping. If not, it doesn't know it's a Proton game and it won't predict its WM_CLASS automatically.

BlueManCZ commented 4 months ago

If you don't want to change your Steam options, I added a new --proton option in latest commit, which must be used only in combination with --single option. So you would fix your game with:

./sif.py --single 787480 --proton
Tiagoquix commented 4 months ago

Hey, many thanks for this new option! The script works correctly for this Proton game now.