How to create the Minecraft launcher button?

I am trying to run a small minecraft server via Ubuntu desktop 12.04 for my kids. I got minecraft installed and running, but don't want to run via the Terminal all the time. I'm trying to pin a Minecraft button to the launcher and am running into trouble. Here's what I've tried:

  1. Main Menu (alacarte?) but can't find the icon anywhere; can't drag it from the Main Menu list either.
  2. When that didn't work, I tried creating minecraft.desktop & minecraft.sh files.
  3. I was able to download and get a .png file on the launcher but it won't launch anything.

Here's a rundown of all the commands and scripting I've done:

  1. Terminal Script that does work:

    sara@sara-Dimension-4300:~$ cd /home/sara/MCserver
    sara@sara-Dimension-4300:~/MCserver$ java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
  2. "Main Menu" command script:

    java -Xmx1024M -Xms512M -Xincgc -jar /home/sara/MCserver/minecraft.jar
  3. minecraft.sh script:

    #!/bin/bash
    cd $(home/MCserver "$0")
    java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame
  4. minecraft.desktop script:

    [Desktop Entry]
    Name=MineCraft
    Comment=
    Exec=/home/sara/MCserver/minecraft.sh
    Icon=/usr/share/icons/Minecraft_Block.svg
    Terminal=false
    Type=Application
    StartupNotify=true
  5. All files are stored in the MCserver folder. When I open the folder on Launcher, it starts at Home -- then MCserver is one of the folders within Home (I don't see "Sara" as a subdirectory of Home here -- sometimes I see it when accessing other files somewhere).


@edwin: here's the copy of la /home/sara

sara@sara-Dimension-4300:~/MCserver$ la /home/sara
.bash_history examples.desktop .ICEauthority .profile
.bash_logout .fontconfig .java Public
.bashrc .gconf .local .pulse
.cache .gnome2 MCserver .pulse-cookie
.config .goutputstream-KIZ8WW minecraft.desktop~ Templates
.dbus .goutputstream-QXYAXW minecraft.png .thumbnails
Desktop .goutputstream-UZYSWW .mission-control Videos
.dmrc .gstreamer-0.10 .mozilla .Xauthority
Documents .gtk-bookmarks Music .xsession-errors
Downloads .gvfs Pictures .xsession-errors.old
2

1 Answer

The script should read:

#!/bin/bash
cd $HOME/MCserver
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.LauncherFrame

After writing it, you should make it executable, so open a terminal and if the script is in a file called minecraft.sh (check if the casing is right, upper and lower case matter!):

$ cd $HOME/MCserver
$ chmod +x minecraft.sh

Finally you must put minecraft.desktop in /usr/share/applications or in $HOME/.local/share/applications (not both, only one of the two):

  • Do this if you want all users to have the Minecraft icon:

    $ sudo mv minecraft.desktop /usr/share/applications

  • Or do this if you want only the current user to have the Minecraft icon:

    $ mv minecraft.desktop $HOME/.local/share/applications

The launcher should appear in the Unity Dash (so you can search for it typing "Minecraft"). Then you can just drag it to the panel.

11

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like