WM_CLASS, Icons, and wine-proton
Posted by Cameron Vanderzanden on
Tags: freebsd, linux, shell, software.
Window managers and taskbars use WM_CLASS to set resources or change behavior for windows on systems running X Windows. Newer versions of Wine set WM_CLASS to the process name, e.g. "Renoise.exe". According to this commit from 2019 wine-proton sets WM_CLASS to "steam_app_" plus the content of the environment variable "SteamAppId" or "steam_proton" if that env variable is empty. This means that if you use proton without using Steam (like me) then every program you run through Wine will have the same icon.
Fortunately this is very easy to fix. I write wrapper shell scripts for the MS Windows software I use anyway so it's simple enough to set "SteamAppId" to a value for each program (and then specify icons for the now-unique WM_CLASS). A probably unnecessary example:
#!/bin/sh export WINEPREFIX="/z/software/Win64/Renoise/" export SteamAppId="renoise" cd $WINEPREFIX/drive_c/Renoise /usr/local/wine-proton/bin/wine Renoise.exe 1>/tmp/rns.out 2>&1 &
I spent some time digging into this a few days ago after installing WindowMaker & being annoyed that I couldn't set icons for the different MS Windows programs I use.
If you've written a response to this post then please let me know the URL:
You can also submit a "comment" webmention by pressing the button below. It may take a day or two for your comment to appear here and a copy of your comment will be stored at commentpara.de.