2012-10-17

Adding executables to the new Unity launcher

I've started using Spring Tool Suite for Java development using Spring, but when installing it on Ubuntu 12.04, I didn't get an icon on the launcher. The link helps to avoid having to navigate to and run the executable every time, but I had to do some searching to find out how to add them.

I found a question on AskUbuntu pretty quickly, but it wasn't until the sixth answer that I found a method that worked for 12.04.

It's pretty simple, so here's how I did it for STS:
  1. Create a desktop file.
    $ cat >> ~/.local/share/applications/sts.desktop
    [Desktop Entry]
    Name=STS
    Comment=
    Exec=<STS_INSTALLATION_DIR>/STS
    Icon=<STS_INSTALLATION_DIR>/icon.xpm
    Terminal=false
    Type=Application
    StartupNotify=true
    
    If the executable or icon are in your $PATH, you don't need to specify the full path.
  2. Make the file executable.
    chmod 755 ~/.local/share/applications/sts.desktop
    At this point you can start the application by double-clicking the desktop file.
  3. Leave the file in ~/.local/share/applications/ to keep it to yourself, or to /usr/share/applications/ to make it available to all users.
  4. To add it to the launcher, just drag it to the launcher and drop it where you want it.

No comments:

Post a Comment