6

I have created file /home/pi/Desktop/DecoderPro.desktop with the contents

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=DecoderPro
Comment=JMRI DecoderPro
Icon=/home/pi/JMRI/resources/dp3_48x48.gif
Exec=/home/pi/JMRI/DecoderPro
Terminal=false;

Each time I click the icon on the desktop I get the message:

This text file 'DecoderPro' seems to be an executable script. what do you want to do with it "desktop entry"?

Is it possible to make this desktop shortcut to start automatically, without the message?

EDIT: It seems that /home/pi/JMRI/DecoderPro is the source of the problem. It is also script starting with #! /bin/bash. But it is also +x.

Currently I have buster 10 version and if I remember right, in previous version of Raspbian this worked.

12
  • 1
    Did you try to make it executable? chmod +x ~/Desktop/DecoderPro.desktop – jake Jul 15 '19 at 11:59
  • Yes. Didn't help. – Pygmalion Jul 15 '19 at 12:20
  • @jake Maybe this will help. /home/pi/JMRI/DecoderPro is also a script that starts with #! /bin/bash. It is also +x. – Pygmalion Jul 15 '19 at 16:09
  • @Pygmalion, And if the problem came from the line: Comment = JMRI DecoderPro, DecoderPro is also after this space ... try:Comment = "JMRI DecoderPro"maybe? – Ephemeral Jul 15 '19 at 16:44
  • @Ephemeral No, it didn't help. – Pygmalion Jul 15 '19 at 16:47
5

Create a file /home/pi/Desktop/test.desktop:

[Desktop Entry]
Version=1.1
Name=test
Comment=The official
Icon=emblem-debian
Type=Application
Path=/home/pi
Exec=bash test
Terminal=true

bash script named test (UTF-8) in /home/pi dir:

echo hello world
read

adjust rigth:

chmod u+x /home/pi/test

Then open: ~$ pcmanfm go to Edit/Preferences/General, Check box for "Don't ask options on launch executable file" ref

Edit: Terminal must be true if you want to see the output of your script.

Tested on fresh Raspbian Buster install.

7
  • OK, this works for me. It is not on the desktop screen though... – Pygmalion Jul 15 '19 at 20:04
  • @Pygmalion, yes no icon on desktop. I would read more about this later and update my answer if needed. You have 3 tools starting with desktop-file-edit , desktop-file-verify and desktop-file-install , when I use edit tool, nothing is done. – Ephemeral Jul 15 '19 at 20:06
  • Actually when I used desktop-file-install, there was error because of using semicolon. It seems that semicolon after Terminal=false is also a problem. Original question is about icon on the desktop screen, so I would appreciate if you find the solution in that way. – Pygmalion Jul 15 '19 at 20:09
  • @Pygmalion, Yes indeed my answer is not really correct but it is an approach that works and that will surely help me to understand the future. I am currently looking for the desktop. – Ephemeral Jul 15 '19 at 20:11
  • @Pygmalion, it's ok after some hours , it's just a checkbox to uncheck, ho ! – Ephemeral Jul 15 '19 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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