Add items to Ubuntu 12.04 Unity Launcher (quicklaunch)

The recent upgrade to Ubuntu 12.04 Precise Pangolin left me somewhat hanging when it comes to creating launchers on the desktop, and also in the Unity Launcher (also called quicklaunch in some places) for Zend Studio and PHPStorm. In Gnome prior to Unity in Ubuntu it was easy to right click the desktop and select Create Launcher to create icons on the desktop to launch applications or scripts, but in 12.04 that options is gone. So here is how I solved some of the issues.

I will cover adding Eclipse to the launcher, adding Zend Studio to the launcher, and PHPStorm to the launcher.

Method 1 (easiest)

For Netbeans and Eclipse based editors like Zend Studio or Aptana it is not too bad. I created a {name}.desktop files for each one and put it in the /home/{username}/.local/share/applications/ directory. Here is how I created a zendstudio.desktop file:

Note: If you want this option to be available for all users you can alternatively create the file in the /usr/share/applications/ directory, but that requires superuser permissions.

[Desktop Entry]
Version=1.0
Name=Zend Studio
Comment=PHP IDE for PHP development
Type=Application
Categories=Development;IDE;
Exec=/home/{username}/Zend/ZendStudio/ZendStudio
Terminal=false
StartupNotify=true
Icon=/home/{username}/Zend/ZendStudio/icon.xpm
Name[en_US]=Zend Studio

After creating the file above I rebooted. Following the reboot I was able to click the Unity Dash Home button, type “Zend” in the search field, then drag and drop the Zend Studio icon to the launcher where I wanted it to be. Now the application stays in the Unity Launcher.

For PHPStorm see method 3 below.

Method 2

Another method I found was to install the ‘gnome-panel’ package. (Actually it was already installed on my system for some reason.)

sudo apt-get install --no-install-recommends gnome-panel

With the gnome-panel I was now able to create a launcher on the desktop using the command below.

gnome-desktop-item-edit ~/Desktop/ --create-new

In the create launcher dialog I filled it out as follows:
Type: Application
Name: PhpStorm
Command: /bin/bash /home/username/PhpStorm/PhpStorm-117.257/bin/phpstorm.sh

NOTE: You could use /bin/sh or whatever shell you use. I use bash so that is why I put /bin/bash.

To create a shortcut in the Unity Launcher I double clicked the new desktop launcher I created above. (NOTE: If you start PHPStorm by executing the phpstorm.sh you do not get any options at all when right clicking the icon in the Unity Launcher.) Then when PHPStorm was running I was then able to right click on the icon in the Unity Launcher and selected “Lock to Launcher”. Voila! Now I have phpstorm on the Unity Launcher.

Method 3

This option is built right into PHPStorm. The wonderful people at JetBrains created a handy item in Tools to automatically create a menu item for you. Simply click on Tools->Create Desktop entry…and now you can Lock to Launcher the next time you run it. Start the JetBrains PhpStorm IDE from the Unity Dash you can then right click on the icon that shows up in the Unity Launcher and select “Lock to Launcher”. The icon now stays there, even after a reboot/logout.

Update:

Method 4

See comment to this post below by Shinybird on using Ubuntu Tweak. (Not sure if it works, but it sounds good.)

Enjoy!!!

Comments

  1. Method 1 works great! I used it to creat a shortcut for Aptana Studio 3. -Ubuntu 12.04


    Nate
    May 7th, 2012
  2. I used Method #2 in Ubuntu 12.04. Floppy mounted and launcher successfully created. Worked well. Thank you so much for this solution.


    Laurine P
    May 7th, 2012
  3. 1) Install “Ubuntu Tweak” and launch it (find Ubuntu Tweak here http://ubuntu-tweak.com/)
    2) Select “Admins” tab, click on the “Scripts” from the Personal category
    3) You will see 2 columns Enabled Scripts and Disabled Scripts
    4) Find “Create Launcher…” in the Disabled Scripts column and drag it to Enabled Scripts column under nautilus-scripts
    5) Go to the folder where you have the file to be added to the launcher and right click anywhere on the folder and select Scripts -> Create Launcher… from the context menu
    6) Create Launcher dialog box pops up. Give a name, Browse for the file, Add an icon and comment if you need. The launcher is created in the current folder
    7) Drag the launcher to the Unity Launcher and you are done

    If the script doesn’t show up in the context menu restart Nautilus (File manager) using the following command

    nautilus -q


    shinybird
    May 16th, 2012
  4. The method using Ubuntu-Tweak worked perfectly. Many, many thanks!

    Jorge.


    Jorge
    May 18th, 2012
  5. Ubuntu-Tweak worked like a charm!
    Install it via

    sudo dpkg -i ./path/to/ubuntu-tweak-installer.deb

    and to avoid crashes on startup, check for required dependencies with

    sudo apt-get install -f

    Also check to have gnome-panel installed, or the “Create Launcher…” script won’t run anyway.

    sudo apt-get install gnome-panel


    ifthenelse
    May 19th, 2012
  6. Ubuntu tweak do the job perfectly!
    THX!


    Pavel
    May 23rd, 2012
  7. method 2 worked for me
    I wanted a link to CUPS printing admin through FireFox
    the command line is
    firefox localhost:631\admin

    Thank you
    Gaz


    kitfoot
    May 31st, 2012
  8. Excellent work. Thank you. I used method 2.


    Dermot
    June 1st, 2012
  9. When selecting Create Launcher the dialog box does NOT pop up.


    Jeremy
    June 19th, 2012
  10. Works fine.


    EngineeringDuniya
    June 29th, 2012
  11. Method 2 Cheeeerrrrrrrrssssssss


    Mehboob
    July 3rd, 2012
  12. Ubuntu-Tweak has solved all those niggly head-scratchers about Ubuntu configuration for me, not just making launcher icons! Thanks for the tip! Miles better than Compiz for twiddling with Unity.


    Bob
    July 9th, 2012
  13. Method #2 worked nice for me…Thank you so much! Cheers from Italy


    Claudio Sparpaglione
    July 10th, 2012
  14. Method 1 worked for Eclipse Juno for me, only thing I had to do was right click on the eclipse.desktop file and go to properties and check the Allow Executing file as program under the permissions tab before it would work when double clicking the desktop file. Thanks :)


    Paul
    July 10th, 2012
  15. Method #4 , excellent.

    Because i need to execute phpStorm as root i use this command for launcher:

    gksudo ./phpstorm.sh

    and then gnome show me a little popup for input the root password before to execute the file ;)

    Cheers,
    SERGI


    caos30
    July 19th, 2012
  16. What a nightmare. I have used the information gleaned to write a info page for Commonist on Wikimedia. Please feel free to edit if I have blown it.
    http://commons.wikimedia.org/wiki/Commons:Tools/Commonist#Unity_desktop_in_Ubuntu_12.04


    Clem Rutter
    July 21st, 2012
  17. I do not understand why Ubuntu is trying to make use of their distribution difficult for users. If I want an icon on my desktop, I should be able to put it there with ease. Limiting user functionality does not make users happy. This does not make me want to continue using Ubuntu.


    Fred Meyer III
    July 25th, 2012
  18. Hey, thanks for a nice how-to!
    As I was struggling with PhpStorm, I’ve tried method #2 first, and it created the desktop icon, but I still could not pin it to the launcher (I’m using Gnome 3 instead of Unity). But method #3 worked like a charm. And then I was wondering – why is it below #2?.. Try #3 first and if that fails (or phpStorm is older), only then move on to #2.
    Cheers!


    emki
    July 30th, 2012
  19. Easing my way into Precise & setting up launcher for claws-mail. Have found that .desktop file in ~/.local/share/applications/ (not ‘local/applications/’) overrides one in usr/share/applications.

    Ed


    Ed Rippy
    August 3rd, 2012
  20. hi, thank you so much, #2 it worked !


    habao
    August 4th, 2012
  21. Ubuntu Tweak method works but my question is how to get the icon OFF the desktop and ON the launcher? As of now, I have the icon in the launcher but if I send the desktop icon to the trash, the launcher icon follows. I don’t want my desktop cluttered with the same shortcuts as the launcher. Is this possible?

    Thanks


    Campbell
    August 5th, 2012
  22. Tweak looks good. Can’t see any problem with it other than the fact that it is not working.

    Create launcher…does not do anything on a new laptop with 12.04. Creating launchers is a bit like rockets science when using Unity.


    Onno
    August 7th, 2012
  23. This is why I don’t like Unity. Things I could ‘just do’ in Gnome 2, because it was simply obvious how to do them, now require me to go searching google to figure out.

    I thought Unity was supposed to easier to use. So far it has not been the case.

    Back in the days when I switched from Mac to Ubuntu with Gnome 2, I found it instantly easy to use. Anything I wanted to do seemed intuitive. With Unity this simply is not the case.

    Come on now, creating a launcher should be easy, not something I have to hack some files with a text-editor for.

    I guess Unity will get better (one can hope :-) but removing things like ‘Create launcher’ from 12.04 doesn’t seem like thats going the right direction.

    Anyway, thanks for your post. Very helpful :-)


    Kris
    August 13th, 2012
  24. used method and it worked nicely!! thanks!


    tulio
    August 31st, 2012
  25. Method #2 does not work for me.

    It creates an icon on the desktop which I can edit. But dragging it into the icon bar (or whatever it’s called) it loses it’s icon.


    gman
    September 4th, 2012
  26. Just what I needed, thanks for the post!


    Herick Oliveira
    September 12th, 2012
  27. You can create a launcher (also edit existing one) for any application via Main Menu in a GUI taste.

    1. Type main menu in the Dash, then launch it,

    2. select a category from the Menus tab on the left i.e Programming (if it’s not there expand the Applications item by clicking on it),

    3. then click on Add Item from the right. Create launcher window will pop-up.

    The rest of it is self-explanatory.


    Sujon Miya
    September 17th, 2012
  28. This method worked for me to add Terminal and Komodo IDE.
    After launching the program for example via command line, then I right click on the icon in the launcher and “lock to launcher”


    Rishad
    September 18th, 2012
  29. Used method #4, Ubuntu-Tweak. Worked perfectly, and Ubuntu Tweak is a very handy tool


    DPM
    September 23rd, 2012
  30. #1 works for me with PhpStorm. But I created .desktop file in ‘/home/user_home/.local/share/applications’, instead of creating it in ‘/usr/share…’.

    *And gave +x (executable) permission to the .desktop file. That’s it!!!

    Thanks a lot.


    Keerthi
    October 1st, 2012
  31. If method #4 did not produce a Dialog Box as mentioned by Jeremy, you probably don’t have gnome-panel installed:

    sudo apt-get install gnome-panel

    Method #4 worked perfectly for me after that.

    Cheers!


    xr440dude
    October 5th, 2012
  32. Thank you. Very helpful.


    Paul
    October 13th, 2012
  33. I found a much easier method quite by accident. Open the program you wish to have a launcher for. Then minimize it; it gets minimized on the launcher. If you right-click that icon, it gives an option ‘lock to launcher’. Then even when you close the program, the launcher stays.


    Venugopal
    October 15th, 2012
  34. Campbell wrote:
    “Ubuntu Tweak method works but my question is how to get the icon OFF the desktop and ON the launcher? As of now, I have the icon in the launcher but if I send the desktop icon to the trash, the launcher icon follows. I don’t want my desktop cluttered with the same shortcuts as the launcher. Is this possible?”

    I found that the original shortcut needs to exist for the Unity launcher to keep it. The original does not have to be on the desktop, however. I have a shortcut in my home folder, and dragging it to the Unity launcher works fine.


    MrMaw
    October 16th, 2012
  35. For most, though not all, apps, you can start the app manually, then right click on its “running” icon in the launchbar and choose “Lock to Launcher”.

    This works for me about 90% of the time, the exception being oddball apps that are not installed through the registry (ie. compiled from source or pre-compiled binaries)


    Aaron
    October 22nd, 2012
  36. Wow, using Ubuntu Tweaks Method work like a charm! Thank you! :D


    Fandy Akhmad
    October 28th, 2012
  37. Check https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles for an up-to-date and complete documentation.


    Michael Schmid
    December 3rd, 2012
  38. Thank you for your post… it is a problem adding simple .sh scripts to the Unity dash.

    Have a nice day,
    Fabio


    Fabio Buda
    February 3rd, 2013
  39. Just to clarify, methods #2 and #4 are the same. Ubuntu tweak uses the same command in his scripts to create the Quicklaunch!


    Pablo
    February 28th, 2013
  40. [...] I had to google and found a nice post, which explains how to add Shortcuts to the launcher. I don’t like all the options where you [...]

  41. Pretty great post. I just stumbled upon your blog and wanted to say that I’ve really loved surfing around your blog posts. In any case I’ll be subscribing on your feed
    and I’m hoping you write again soon!


    western clothing stores
    June 29th, 2013
  42. Ubuntu tweak did the job. Fast and clean!


    Erick
    July 30th, 2013
  43. Thanx to your tutorial I managed to add aptana studio on my launchbar. Thank you very much


    themis
    August 2nd, 2013
  44. Thanks, this worked very well for Freeplane, was able to “lock to launcher” using method #2. Method #1 didn’t work for me. Good useful list!


    grateful
    August 12th, 2013
  45. The drag and drop also works. click the ubuntu icon on the top of launcher ,type programme name when the icon appears just drag it to the quicklaunch bar . so simple and easy :)


    lalit
    August 16th, 2013
  46. Method 1 works great! I used it to creat a shortcut for Sublime Text 2. -Ubuntu 12.04


    Inigo
    August 24th, 2013

RSSSubscribe to my feed now.

About Me

Adam Culp (GeekyBoy)
Adam Culp (GeekyBoy) is a Zend PHP 5.3 certified engineer and member of the Zend Certification Advisory Board working as a Senior Professional Services Consultant at Zend Technologies. He enjoys technology and posts things he finds interesting to this blog, mostly so he remembers, but also to help others. As organizer of the South Florida PHP Users Group (SoFloPHP), as well as the SunshinePHP Developer Conference in Miami, he is passionate about the PHP community. He also created ReqHarbor.com to help others gather and manage application requirements, and set up OutsourceHarbor.com to help companies find great developers. Read More >>
Zend PHP 5.3 Certified Zend Certification Advisory Board
Pair with me

profile for Adam Culp at Stack Overflow, Q&A for professional and enthusiast programmers