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.

I have searched for information about this, but not found anything directly related to it.

Is there a way to add a document (for example, a Libre Office file or text file) to open when clicked from the top bar or the side bar? Similarly, is there a way to permanently attach an icon to either the top or side bar that when clicked will launch a shell script or a perl script? Dragging a text file, libre office file, or perl script to the launcher does not seem to work as it does for other applications.

Any ideas or suggestions on where to look for information about this?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

What you want to do is create a custom launcher for your scripts/documents. You can do that in a text editor with the following:

[Desktop Entry]
Name = NAME_TO_DISPLAY
Exec = COMMAND_TO_RUN
Icon = NAME_OR_PATH

Just save it with a .desktop extension and make it executable. If you save it in ~/.local/share/applications the launcher will be accesible via the Dash. Dragging it to the launcher bar will fix it there. The exec line to open a document or weblink should just be xdg-open FILE to open with a default program. For more on the launcher file specifications see here.

As a drag-n-drop shortcut to add files to launchers for quick execution via quicklists or mini-dashes, check out Drawers in the Software Center for purchase, or you can install it via ppa for free (there will just be a reminder every 100 uses to donate, unless you donate).

share|improve this answer
    
Thank you. This worked. I ended up installing gnome-panel, per the instructions that you referenced here: sudo apt-get install --no-install-recommends gnome-panel and then used it as follows: gnome-desktop-item-edit ~/.local/share/applications appname.desktop –  user124952 Jan 30 '13 at 18:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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