Saturday, December 08, 2012

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.
Method 1

For Netbeans and Eclipse based editors like Zend Studio or Aptana it is not too bad. I created a *.desktop files for each one and put it in the /usr/share/applications/ folder. I believe you can also create a folder in /home/username/.local/applications/ and put it there instead, but I have not tested it. Here is how I created a zendstudio.desktop file:

[Desktop Entry]
Version=1.0
Name=Zend Studio
GenericName=Zend Studio
X-GNOME-FullName=Zend Studio PHP IDE
Comment=PHP IDE for PHP development
Type=Application
Categories=Application;Development;PHP;IDE;Programming
Exec=/home/username/Zend/ZendStudio-9.0.2/ZendStudio
TryExec=/home/username/Zend/ZendStudio-9.0.2/ZendStudio
Terminal=false
StartupNotify=true
Icon=/home/username/Zend/ZendStudio-9.0.2/icon.xpm

After creating the file above I then launched Zend Studio by going to the Zend folder in my home directory and double clicking the ZendStudio executable. Once the application is running I right clicked the icon in the Unity Launcher and select “Lock to Launcher”. Now the application stays in the Unity Launcher.

The above worked for most applications, but did NOT work for PHPStorm which launches by using a shell script named PhpStorm.sh. I tried doing the method above, and I also tried creating the desktop file and then dragging and dropping it to the Launcher, and that did not work either.

No comments: