Zorin PRO create executable desktop shortcut

Good day all
I would like to create a desktop shortcut to an executable that will run by double clicking.

I want the executable to be available to anyone logged in as long as they have the shortcut on their desktop. I have it the shortcut on my desktop but the only way it will run is to right click and select "Run as a program".

If I right click and display the properties, it lists the Permissions as "Read-Only". The "Executable as Program" toggle is pale blue and to the right (I'm assuming that means executable?) with the whole line grayed out. If I click into the Permissions tab, it shows the Group and Others perms as read only. (screen shots below).

How do I get it to execute by clicking/double clicking please?
Secondary (and much less important): Is there a way to change the Desktop icon please?

What I have done so far:

Create a script, /usr/local/bin/my_script.
Set the perms on it to 755
-rwxr-xr-x 1 root root 268 Feb 23 17:13 /usr/local/bin/my_script
This executes correctly from the command line anywhere in the system.

Create a symlink on my desktop by doing ln -s /usr/local/bin/my_script ~/Desktop
lrwxrwxrwx 1 zpc zpc 23 Feb 23 17:15 my_script -> /usr/local/bin/my_script
As mentioned above, this executes correctly if I right click and select "Run". If I double click it opens in a text editor.


Thanks,
Robin

You want to create a .desktop file, not a symlink.
Using a desktop file, you can specify the icon, and its path, as well.

1 Like

The guide doesn't show how to do it with a script which hasn't already a .desktop file.

For scripts you can use the menu editor. Right-click on the Zorin start menu icon, then select "edit menu" and create a new entry there. Name it as you want. As command enter the path to your script. Then click on the folder to set an icon for your launcher, without selecting an icon the launcher won't work. After it is created you can add it to the desktop.
Make the file executable in the properties (right-click on the .desktop icon).

2 Likes

The Owner is set to root. So, that's the Reason why it is read-only and not changeable. You could change the Ownership but maybe try one of the other Suggestions first.

1 Like

Thank you Forpli, this worked perfectly. The only difference is that it worked fine without setting an icon.

1 Like

Thank you Aravisian, that was a very helpful article. One caveat, as Forpli noted it doesn't cover user created scripts.

As a note for anyone who may be reading this in the future, while the system default for application .desktop files is /usr/share/applications, user created .desktop files go in ~/.local/share/applications

Duhhh. You'd think I would have seen that. Eh, I'm not so pretty bright some days. Thank you Ponce-De-Leon for the heads up on that miss. I appreciate it.

All apps which have a .desktop file you can find in start menu and you can much easier add them to the desktop by right-clicking on the app and selecting "add to desktop*.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.