Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How can I create launchers on my desktop?
How to add a shell script to launcher as shortcut

I open my favourite IDE (PhpStorm) using a custom bash script. I would like to add the script to the Unity launcher.

I thought I could add it by clicking the "keep in launcher" option, and sure enough, the icon stays on the launcher after I close the app. But clicking the icon doesn't reopen the IDE - the launcher just sits there, flashing. When I relogin in, the launcher icon is gone.

Anyone got any ideas how I can make this work?

share|improve this question

marked as duplicate by belacq, ajmitch, Jorge Castro, SirCharlo, RolandiXor Aug 22 '12 at 15:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers 4

Not refuting the previous answers in any way, but there are a couple of other options you may or may not which to consider:

  • If you have too many icons in your launcher and you don't like the accordian effect, you can add multiple executables accessible through "right clicking" one icon. Search "unity shortcut group" or "unity quicklist" for lots of examples.

  • You can access scripts directly from your desktop via "right click" context menu. Search "Nautilus Scripts" for howtos and examples. These can be especially useful for context specific actions on objects you see/select in the nautilus filesystem browser (for example, I use scripts to "open a terminal here" and "Edit with VIM" a lot).

One solution is no better than the other ... just a few more options to consider depending on the specifics of what you want.

share|improve this answer

Use

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

in terminal to create a launcher in desktop. I've tried it in Ubuntu 12.04 and it works.

Actually, it works only if you have gnome-shell installed. But I have tried and found that even if only gnome-desktop-item-edit is present, it can still work.

share|improve this answer

I created one for Gnome Screensaver, and saved it to: ~/.local/share/applications/

you may need to create this directory:

mkdir ~/.local/share/applications   (if required)

screensaver.desktop

[Desktop Entry]
Name=Activate Screensaver
Comment=
Exec=gnome-screensaver-command -a
Icon=screensaver
Terminal=false
Type=Application
StartupNotify=true

Then simply search in Dash for the 'Name', and move icon to launcher.

share|improve this answer

Launchers are *.desktop files, and making them is fairly easy. I do agree with you in that Unity should create a working launcher automatically, but in this case it looks like you will have to create the launcher yourself.

To create a launcher, just follow these steps:"

  1. Right click on your desktop, and select Create Launcher
  2. Name it as you like, and select for it the icon of your preference
  3. In the Location entry, enter the location to your *.sh script - remember that it must be executable or else the launcher will not be able to open your application
  4. The comment, needless to say, is optional to enter

Check out this guide on creating launchers for more information.

Once that you have your launcher working, move it to ~/.local/share/applications/ (where you will find other launchers perhaps), launch the application and pin it to Unity. I think it will work afterwards, if not let me know.

share|improve this answer
2  
Thanks Wolter - unfortunately I'm stuck at the first hurdle - I can't find a "create launcher" option anywhere. –  hippyjim Nov 8 '11 at 15:11
1  
Update: I found out how to create a launcher here so at least i can reach the app now - but "pinning" to the unity panel still doesn't work. it stays there after the program is closed - but when I try to reopen, it just flashes for a few seconds, then nothing. After a log out & back in, the launcher is no longer pinned either –  hippyjim Nov 8 '11 at 15:24
1  
Ok, more - looks like this is a known bug: bugs.launchpad.net/ubuntu/+source/bamf/+bug/754334 –  hippyjim Nov 8 '11 at 15:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.