ka1958 has asked for the wisdom of the Perl Monks concerning the following question:

I feel a little silly asking this question.
I have been a linux user for many years comming off Unix from the old days when PDP11's were common, and have been a Perl coder for much of those years.
A friend of mine one day asked why I allways fire up my Perl apps. from a terminal, "just add a shortcut to the desktop!" he added.
This seemed a logical thing to do. I only use the terminal out of habit.
So I decided to follow his advice, but do you think I could do it?
I have tried everything I know, but can not create a working shortcut on my X-Gnome desktop to my Perl apps.
I have done a search in your wonderful database but not a thing.
Is there some trick to this seemingly simple task or is it not possible.

2006-06-14 Retitled by GrandFather, as per Monastery guidelines

  • Comment on (OT) Creating Shortcut to Perl Applications in Gnome

Replies are listed 'Best First'.
Re: (OT) Creating Shortcut to Perl Applications in Gnome
by gellyfish (Monsignor) on Jun 12, 2006 at 08:08 UTC

    As well as adding the launcher through the GUI as others have suggested, you can add them by hand (or programmatically) by adding the the appropriate .desktop file in your 'Desktop' directory. The files are similar to Windows .INI files and you might have something like:

    [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Exec=/home/jonathan/test/smtest TryExec= Icon=/usr/share/pixmaps/Brain.xpm X-GNOME-DocPath= Terminal=true Name[en_GB]=Foo GenericName[en_GB]= Comment[en_GB]=
    Obviously substituting your own values. If for some reason you don't want to give your Perl program an executable mode you can prepend the path to perl in the Exec like just like you would at the command line.

    /J\

Re: (OT) Creating Shortcut to Perl Applications in Gnome
by wazoox (Prior) on Jun 12, 2006 at 07:08 UTC
    To create a desktop application launcher, right-click on the desktop, "New Laucher", enter the path of the application and the name of the launcher. Where's the problem ? If your app isn't an X11 app, launch it in a terminal like this :xterm -e myapp
Re: (OT) Creating Shortcut to Perl Applications in Gnome
by Joost (Canon) on Jun 12, 2006 at 07:09 UTC
    It's definitely possible as long as your scripts are executable by themselves (i.e. they need the right #!/usr/bin/perl line and permissions).

    Once you've done that, you can create a shortcut on the desktop using the same method you use for creating shortcuts to other programs. Alternatively, you can create a symlink in the desktop directory to the executable.

Re: (OT) Creating Shortcut to Perl Applications in Gnome
by ka1958 (Initiate) on Jun 16, 2006 at 02:24 UTC
    Thanks guys for the assistance.
    It's nice to know I was doing it the correct way.
    It seems the issue is with the current flavour of Linux I am using, being Ubuntu.
    I will contact the Ubuntu Monks for their wisdom on this topic and will post back here with their responce. :)