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

Add WM_CLASS for TF2 Linux #40

Open Tiagoquix opened 4 months ago

Tiagoquix commented 4 months ago

This closes #37.

BlueManCZ commented 4 months ago

I'm afraid we cannot add a second identical WM_CLASS to the database. It already belongs to Half-Life 2. That would cause problems if we had installed Half-Life 2 and Team Fortress 2 together, as the desktop manager wouldn't know which one of these two .desktop files to use (since WM_CLASS should be unique to properly link running instances and their .desktop files).

To actually fix and close #37 and #41 we need to figure out why the fix-wm-class.sh script is not finding windows correctly in your case and therefore not exiting itself and hanging Steam in running state as well.

Can you please try to follow these steps and report your observations?

  1. Remove this new WM_CLASS from the database.
  2. Make sure the file ~/.local/share/applications/steam-icons-fixed/Team-Fortress-2.desktop exists and contains StartupWMClass=Team Fortress 2 - OpenGL line.
  3. Run Team Fortress 2 without launch options and minimize it. It should have the default icon.
  4. Execute xdotool search --sync --name "Team Fortress 2 - OpenGL" set_window --classname "Team Fortress 2 - OpenGL" --class "Team Fortress 2 - OpenGL" %@ and watch if it exits and fixes the icon.
Tiagoquix commented 4 months ago

Hello there. The xdotool command you provided does nothing.

I've also tried to replaced the Team Fortress 2 - OpenGL with hl2_linux for the last two ones (since they require the WM_CLASS attribute) but it didn't work.

Tiagoquix commented 4 months ago

Also, the script doesn't continue and gets stuck on the terminal.

Tiagoquix commented 4 months ago

By the way, previously, when adding a second hl2_linux to the databases file, the script would not be able to add the launch options automatically. So, yeah, it's not desirable to do it.

BlueManCZ commented 4 months ago

The xdotool command you provided does nothing. Also, the script doesn't continue and gets stuck on the terminal

This is weird. It means it cannot find a window with name "Team Fortress 2 - OpenGL". But it should. At least it does in my case. Can you share xprop output after clicking on the Team Fortress 2 window?

To explain to you what this xdotool command does (and the fix-wm-class.sh script):

By the way, previously, when adding a second hl2_linux to the databases file, the script would not be able to add the launch options automatically. So, yeah, it's not desirable to do it.

Also to clarify, we add launch options only if there is something wrong with the game's WM_CLASS. That means if it is missing or is not unique.

Tiagoquix commented 4 months ago

Hello. Thanks for the explanation.

Here's the xprop output: https://0.jaegers.net/?1f63abf0c0e6a13f#5sHwrYSC6vc8AsRuLa8f2hh6AgPJ3E6XgovetNEeZaGJ