How can I create a Minecraft item in everyone's KDE menu on OpenSuse?

2

1

I set up a family computer running OpenSuse 13.1 for the kids.

I downloaded the Minecraft.jar file, installed Oracle java, and now I can run Minecraft - like this

$ java -jar Minecraft.jar

So far so good. But what about everyone else's accounts? I copied the jar file, and created a startup script like this:

# mv ~user/Download/Minecraft.jar /usr/lib/minecraft.jar
# chown root:root /usr/lib/minecraft.jar
# chmod a+r /usr/lib/minecraft.jar
# cat > /usr/bin/minecraft
#!/bin/bash

exec java -jar /usr/lib/minecraft.jar
<ctrl>-D
# chmod go=rx /usr/lib/minecraft

So, now everyone can run it from the command line

$ minecraft

But, how can I create a desktop icon / kicker entry etc to make it all point-and-click for my users (aka children).

Thanks!

Peter

Posted 2013-12-19T05:57:55.377

Reputation: 681

Answers

3

Both KDE and Gnome have adopted uniform standard for desktop entries. So you could create a plain text file called minecraft.desktop and place it on your desktop or say in /usr/share/applications

[Desktop Entry]
Version=1.0
Type=Application
Name=Minecraft
Comment=Minecraft game for the whole family
Exec=/usr/bin/minecraft
Icon=/usr/share/icons/minecraft/my_minecraft_icon.png.or.svg

You should also be able to right click on Kicker (the app launcher) and choose add option. Then you would be presented with a graphic screen allowing to point to your executable and choose the icon file. For icon file you can use any reasonable size file, I would find a nice svg file on the net and use that. Since paths are absolute - the locations can be at your convenience, just remember that the files will be run with the logged on user's permissions.

r0berts

Posted 2013-12-19T05:57:55.377

Reputation: 1 585

That's the way to go. Note that instead of right clicking on the Kicker icon (if you are using some other application launcher), you can also simply run kmenuedit from the terminal to open it. – Sekhemty – 2013-12-19T13:18:18.313

1Worked quite well thanks. The jar included a .png file (extraced using untar), so I didn't have to add my own. I also added a line "Categories=Game;ArcadeGame;" to make it show in a better place in the menu. – Peter – 2013-12-22T12:17:58.863

0

Just an FYI for anyone else looking to set up a Minecraft launcher icon/shortcut type file such as this... (I'm using Debian "Jessie"/KDE.)

...you'll likely want to use "Exec=java -jar /Minecraft/File/Path/Here/Minecraft.jar" where /Minecraft/File/Path/Here/ is the folder path containing your Minecraft.jar file. You'll also want to make sure to right-mouse-click on the Minecraft.jar as viewed in the KDE Dolphin file browser ahead of time and change its permissions to being executable.

I was likewise able to open the .png file from within the Minecraft.jar file using Ark and then right-mouse-clicked on the open image and chose to save it as Minecraft.png in the same folder as the Minecraft.jar folder. I then used the line "Icon=/Minecraft/File/Path/Here/Minecraft.png" in the mentioned launching file so that it uses the stock Minecraft icon.

Hope this helps some people out there and thanks for the info provided here already. It was of great help to me while getting this set up.

Mick

Posted 2013-12-19T05:57:55.377

Reputation: 1