Proper syntax of `.desktop` files

What is the proper syntax of .desktop files. This does not seem to work when I click on it:

[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Authentication Portal
Exec=/home/j/.local/bin/logon-fw
Icon=

If I run the script /home/j/.local/bin/logon-fw from within terminal it is executed.

From that path, assuming it’s in your $PATH, just logon-fw will execute that command.

Does that work from krunner?

It looks fine to me, but where are you trying to click on it? From Dolphin it may just open a text editor. If you put it in ~/.local/share/applications it should appear in your application menu, and you can launch it from there.

A shot in the dark, but the only other thing I can think is to try Version=1.5 (the latest standard) or remove the Version line entirely (it’s optional). The full standard describes the file format.

I will try that.

Change Terminal to true.

If that doesn’t work then install kde-cli-tools

Then use kioclient path/to/your/.desktop this will show you the error in the console

Thanks and now the problem reveiled it selve. the command contians a /usr/bin/curl command but with terminal on I see

Warning: Could not start program '/home/j/.local/bin/logon-fw' with arguments ''.

Run:

chmod +x /home/j/.local/bin/logon-fw

Nevermind, you said it works through the terminal then I got a question what terminal do you use?

Try this .desktop file:

[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Authentication Portal
Exec=konsole -e /home/j/.local/bin/logon-fw
Icon=

Replace konsole with any terminal you use