4

I've created a Minecraft desktop entry, which works fine, but when I launch Minecraft it creates a new icon in my dock. I know that this isn't really an issue but I switched to elementary OS because I wanted to make everything look perfect. So, how could I fix it so that when I launch Minecraft through the launcher it doesn't create a new icon? enter image description here

enter image description here

Update:

I figured out this has to do with the WMClass thanks to this post How to fix Netbeans 8.1 double icons on plank. But the issue now is that I can only have one StartupWMClass=Minecraft 1.11.2 which won't change when minecraft updates and causes the launcher to create it's own icon. So I have to find a way to launch minecraft with a custom WMClass.

Update 2 - .desktop file:

[Desktop Entry]
Name=Minecraft
Comment=Play Minecraft
Type=Application
Exec=java -jar /home/will/.minecraft/launcher.jar
Icon=/usr/share/applications/Minecraft.png
Terminal=false
Categories=Other;
StartupWMClass=Minecraft 1.11.2
  • You should also share your .dektop file with us, just for information. I'm not sure if it is possible to make the second one disappear, it might depend how the software works. – SamMorrowDrums Feb 14 '17 at 12:09
1

It might be related to your StartupWMClass. In the terminal run xprop WM_CLASS and then click the Minecraft window. Use the value it returns. I ran into the same issue when I created a custom .desktop file for an android emulator and it worked.

  • Thanks for the suggestion, but I already did that. The problem now is that the launcher and the game have a different WM_CLASS. What I need to figure out is how can I group these different WM_CLASS's into one. Either by launching them with a custom WM_CLASS or having two in the .desktop. I'm not sure how I can do that. – user8585 Feb 15 '17 at 20:35
  • Maybe, but having the correct StartWMClass should fix that. Just to confirm the xprop command returns "Minecraft 1.11.2"? When I was trying to get my android emulator to not produce two icons xprop was outputting "-m", "Emulator" but in my .desktop file I had to only put "Emulator" for it to work. I'd trying different variations on you StartWMClass line until it works. – Sean Patterson Feb 15 '17 at 21:35
  • That's true, but the minecraft launcher has a different WM_CLASS than the actual minecraft game. Look at the images in the op to see the two. – user8585 Feb 16 '17 at 21:17
  • Its hard to tell if it has a different WM_CLASS or if your .desktop has a different icon. When I had my WM_CLASS wrong in the example I gave before the other icon that was being launched was different from the one I set in the .desktop file. – Sean Patterson Feb 16 '17 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy