You are not logged in.

#1 2024-09-07 21:03

jagp
Member
Registered: 2024-09-07
Posts: 10

How to execute desktop launcher without confirmation

Dear all,
I want to start an application by clicking on a desktop icon, which should start an executable script through a very simple desktop file named IVA.desktop. It just contains the following lines:

[Desktop Entry]
Name=IVA
GenericName=IVA
Exec=iva.Rsh
Terminal=true
Type=Application
Icon=plan
Categories=Application

The script iva.Rsh is located in /usr/local/bin, and has mode 755. However, when I click on the icon I get a message saying that the text file appears to be a sequence of executable commands. What do you want to do with it? So I must click on the button "Execute" to start the application. Other icons on the desktop start as soon as I click on them. What I am missing? Many thanks for your attention!

Offline

#2 2024-09-17 12:51

jagp
Member
Registered: 2024-09-07
Posts: 10

Re: How to execute desktop launcher without confirmation

No hints? For those that could be interested, I finally managed to solve the problem by mimicking the behavior of other one-click-starting icons:

1. They are a link to another *.desktop file located in /usr/share/applications
2. The above *.desktop file has a line Exec=... which has no path, just the name of the executable file
3. The executable file may be a bash script with mode 755, placed at /usr/bin (I have not tested /usr/local/bin or other suitable directories)
Files described in points 2 and 3 must be owned by root:root

I thought there should be an easiest way, but I am happy with this one by now...

Offline

#3 2024-09-18 08:07

hchiper
Member
From: Belgium
Registered: 2020-07-28
Posts: 521

Re: How to execute desktop launcher without confirmation

jagp wrote:

(...) I get a message saying that the text file appears to be a sequence of executable commands. What do you want to do with it? So I must click on the button "Execute" to start the application.

Is it a message like this one? In this case did you notice the checkbox?
Screenshot


Q4OS machine: Samsung R519 - Pentium T4200 2.0 GHz - 4 GB RAM - 500 GB SSD

Offline

#4 2024-09-19 21:29

jagp
Member
Registered: 2024-09-07
Posts: 10

Re: How to execute desktop launcher without confirmation

I'd love having that checkbox! May be I don't have it because I am using LXDE instead of TDE...

Offline

#5 2024-09-19 22:06

hchiper
Member
From: Belgium
Registered: 2020-07-28
Posts: 521

Re: How to execute desktop launcher without confirmation

Then create a symbolic link on your desktop to your app, not a .desktop file:

~/Desktop$ ln -s /usr/local/bin/iva.Rsh IVA 

Last edited by hchiper (2024-09-20 07:22)


Q4OS machine: Samsung R519 - Pentium T4200 2.0 GHz - 4 GB RAM - 500 GB SSD

Offline

#6 2024-09-20 10:56

jagp
Member
Registered: 2024-09-07
Posts: 10

Re: How to execute desktop launcher without confirmation

Thank you, but the same window appears asking what to do with the file!

Offline

#7 2024-09-20 12:03

jagp
Member
Registered: 2024-09-07
Posts: 10

Re: How to execute desktop launcher without confirmation

Just a correction to my point 1 above: It is not just a symbolic link, it must be a desktop file of type link, like this one:

[Desktop Entry]
Type=Link
Name=IVA
Icon=plan
URL=/usr/share/applications/IVA.desktop

And with respec to to point 3, it works also if located at /usr/local/bin. (It should work when placed at any directory in the user's PATH)

Last edited by jagp (2024-09-20 12:04)

Offline

#8 2024-09-20 13:44

hchiper
Member
From: Belgium
Registered: 2020-07-28
Posts: 521

Re: How to execute desktop launcher without confirmation

jagp wrote:

Thank you, but the same window appears asking what to do with the file!

Please can you run the following commands and post the outputs:

$ ls -l ~/Desktop/IVA
$ ls -l /usr/local/bin/iva.Rsh

Can you describe what happens when you type this command:

$ /usr/local/bin/iva.Rsh

And does your iva.Rsh begin with an appropriate shebang (#!)?

Last edited by hchiper (2024-09-20 14:09)


Q4OS machine: Samsung R519 - Pentium T4200 2.0 GHz - 4 GB RAM - 500 GB SSD

Offline

Board footer

Powered by FluxBB