1

I have some shell scripts (files *.sh) on my Ubuntu desktop, eg. startdoublecmd.sh or startlazarus.sh.

When using Ubuntu 20, those scripts started automatically upon double clicking on them. Now I upgraded to Ubuntu 22 and the scripts open in a text editor instead, and to run them I have to right click and select Run as Program from context menu.

I did not change any configuration, I just upgraded to 22 LTS. How to restore the Ubuntu 20 behavior on Ubuntu 22?

tk_
  • 121
  • 2
  • 1
    I suggest you create .desktop launchers for these kind of stuff. – FedKad Jan 30 '24 at 17:22
  • Not possible since v19 without tweaks. https://askubuntu.com/questions/64222/how-can-i-create-launchers-on-my-desktop – tk_ Jan 30 '24 at 17:43
  • I mean, create an appropriate, say startlazarus.desktop file and put it on your desktop or any other appropriate place. I prefer to pin them to dock or dash. – FedKad Jan 30 '24 at 17:53
  • Yes, you are right (see my answer). – tk_ Jan 30 '24 at 18:19

1 Answers1

1

Finally found solution myself according to the 8th or 9th answer here How can I create launchers on my desktop?.

Eg. for the Double Commander script, I created a file named doublecmd.desktop and copied it to my Desktop folder:

[Desktop Entry]
Encoding=UTF-8
Name=Double Commander
Comment=Run Double Commander
Exec=/home/user/doublecmd/startdoublecmd.sh
Icon=/home/user/doublecmd/pixmaps/mainicon/alt/128px-dcfinal.png
Terminal=false
Type=Application
Categories=Utility;

Then I had to right click on that file (invoke context menu) and select Properties and there I had to check Allow to run file as program.

Then I had to right click on that file once again and select Allow launching.

Pretty horrible way compared to Windows way where you just invoke context menu and click Send to desktop (create link)...

tk_
  • 121
  • 2
  • 1
    To get back the Windows way, you could try mixing https://askubuntu.com/a/1274782/1004020 with one of the earlier GUI answers in your linked question – Daniel T Jan 30 '24 at 22:43