Setting up a Minecraft launcher on Ubuntu 12.04, these steps worked for me, mostly pieced together from the various other tips.
In a terminal, first fetch a Minecraft image icon:
cd /usr/share/icons; sudo wget http://images.wikia.com/yogbox/images/d/dd/Minecraft_Block.svg
Then create a minecraft.desktop file (using the gedit text editor to keep it user-friendly; just enter the whole "gksudo ..." command at the command line):
gksudo gedit /usr/share/applications/minecraft.desktop
and paste in these contents, and then Save of course:
[Desktop Entry]
Name=Minecraft
Comment=
Exec=/opt/minecraft.sh
Icon=Minecraft_Block
Terminal=false
Type=Application
StartupNotify=true
(Note: you can also paste directly into the file by using
sudo sh -c 'xsel -ob > /usr/share/applications/minecraft.desktop'
if you have xsel
installed.)
Finally (almost), open up your file manager and go to /usr/share/applications - either click the Home Folder icon in your launcher and navigate, or here's the terminal quickie:
nautilus /usr/share/applications &
Locate your new Minecraft entry, and drag it over to your launcher bar.
At this point, you're practically done, except in this case I've created a little Minecraft starter script, saved in /opt/minecraft.sh, which assumes the minecraft.jar file is also saved in /opt. You can change all these "/opt" references to be wherever you've saved the original minecraft.jar file (be sure to change the Exec value in the minecraft.desktop file too).
The minecraft.sh file needs to contain just these three lines:
#!/bin/bash
cd $(dirname "$0")
java -Xmx1G -Xms512M -cp minecraft.jar net.minecraft.bootstrap.Bootstrap
(NOTE: for versions older than 1.6.1, you will need to use net.minecraft.LauncherFrame
instead of net.minecraft.bootstrap.Bootstrap
. The internal structure of the file and classes has changed as of 1.6.1.)
and of course that script needs to be executable, e.g. with the command
sudo chmod a+x /opt/minecraft.sh
If you have a system with more memory or notice poor performance when playing with higher render distances, you can increase the value of the -Xmx1G
flag as desired. This tells Java the maximum amount of memory it's allowed to use. -Xmx1G
means that it has a cap of 1 GB. -Xmx2G
would be 2 GB, -Xmx3G
would be 3 GB, and so on.
That's it! Using the starter script, and ensuring it cd's to the folder that contains the minecraft.jar file, seems to be a helpful step that other instructions overlooked.
Short but annoying answer: reboot (or perhaps just log out) after installing new applications until this bug is fixed.
Longer answer:
I just installed Chromium today (nothing wrong with Firefox but I also need to use Chromium for work) and was frustrated because I couldn't get it to maximize on my second monitor! I could move it to the second monitor but if I hit the window-maximize button, it jumped to the main monitor (maximized). Because of the problems I described above (with PG Admin and Pidgin).
I glanced at the launcher icon and saw that it didn't indicate that Chromium was running. Clicking the launcher opened a new Chromium window. On a whim I restarted the computer (maybe could have just logged out), and... both problems are solved! Chromium maximizes, and launcher knows it's running. I expect that it wouldn't have appeared in the switcher either, but forgot to try that.
I left the Windows world 12 years ago and haven't looked back. One thing that's been nice with Linux is rarely having to reboot the computer to "fix" anything. But today it feels like I'm having a bad Windows flashback. Still trying to be patient with Unity.
So it appears that there is a bug that only occurs for newly-installed programs. I don't know if it's something in the installer scripts or if Unity can be blamed for not discovering them, but I never had this problem with classic Gnome. I will follow up on this page once I install another GUI app and report whether this happens with every new app or just certain ones. I should probably also file a bug but I have a feeling it must have already been reported... if only I could find the right search terms.
Best Answer
I have since discovered how to do this. I wrote a blog post to help others accomplish the same task.
http://www.codetunnel.com/blog/post/121/how-to-add-teamspeak-3-to-the-unity-launcher-in-ubuntu
I searched around for quite a while and just couldn't seem to find how to add custom applications to the Unity launcher (side bar) in Ubuntu. After much investigation I have found that applications that show up in the dashboard and on the Unity launcher have corresponding
appname.desktop
files in/usr/share/applications/
.I created one for TeamSpeak 3 on my machine. Here is what my
Teamspeak3-client.desktop
file looks like:Obviously you would modify the version number to reflect the version you have installed. Also double-check the path for the "Exec" and "Icon" options. My installation was located in my home directory.