The Linux Page

Gnome Icons not showing up, can't Pin as Favorites ... (Shisen Sho)

I like to play Shisen Sho and even wrote a tool to search for a solution (because at times, the randomized games have no solution even if you ask the game to not create such boards).

However, under Ubuntu 24.04, the icon was missing and I could not pin the game to my favorites. So I search fora  solution and it was actually rather simple. You have to edit the .desktop file and add the startup class info. I find it strange that just a missing field like that would prevent a lot of the functionality for an app. but well...

I found the solution on Ask Ubuntu (a stackoverflow website).

First, you want to determine the window class. To do that, you need the app. to be running so if you do not yet have it running, start it.

Second, in a console / terminal type the following:

$ xprop WM_CLASS

This seamingly gets stuck there, now your mouse pointer should look like a cross. Click on the Shisen Sho application. The xprop command wakes up and write the result:

WM_CLASS(STRING) = "kshisen", "kshisen"

So now we know that the name is exactly "kshisen".

Next, I used the locate command to find the .desktop file:

$ locate kshisen.desktop
/usr/share/applications/org.kde.kshisen.desktop

Finally, I edited that file:

$ gvim /usr/share/applications/org.kde.kshisen.desktop

and, as mentioned in that slackoverflow answer, I added one line:

StartupWMClass=kshisen

It has to appear in the [Desktop Entry] section. In case of Shisen Sho, that's the only section, so pretty much on any line is fine.

I was actually super surprised because (1) it immediately showed the icon instead of the default cog-like icons; (2) and it shows the little red dot under that icon in my favorites! That had not happened in years.