Desktop Shortcut - Launching `program.sh`

[Desktop Entry]
Name=songkong
Icon=/home/aj/songkong/webhelp/SongKong64.jpg
Exec='/home/aj/songkong/songkong.sh'
Terminal=false
Type=Application
Categories=AudioVideo;Player;Organization;Music

What is wrong with this and why won't it execute the file in the location identified by Exec=?

  • I created the .txt, edited with the correct location for Exec= with drag/drop into terminal just to be sure.
  • I saved the file as .desktop on the desktop.
  • I gave the .desktop file exec permissions with chmod +x - again, dragging/dropping the file into terminal just to be sure.
  • I can double-click on the file in the directory and launch the .sh program file.
  • I cannot get the same program file to run when clicking on the .desktop file with the settings shown above in the code block.
  • I've done this once before, successfully, with the same basic desktop entry info.

To be clear, nothing visible happens after executing my shortcut. The file which I'm asking the shortcut to point to is able to be run normally by double-clicking on the program's .sh file in the above-identified home folder.
Thank you!

Can you please open a terminal in the direcotry holding your .desktop file or cd to that directory, then run the following to determine the error. Replace the example.desktop with your actual desktop file name

awk -F= '/Exec=/{system($2)}' example.desktop

You may get something like:
line 3: linuxjre/bin/java: No such file or directory

Thats correct!

Ok... Carefully... lol...
Run this in terminal But Do Not Click y until you check what it is going to install or remove:

sudo dpkg --add-architecture i386 && sudo apt update

sudo apt-get install libc6-i386

This is a tricky one - So, I would really prefer you past the full output here before you hit y so we can double check it. You can use pastebin.com if you need.

EDIT: also you may need to adjust your .desktop file as follows:

[Desktop Entry]
Type=Application
Name=songkong
Icon=/home/mech-one/Downloads/songkong/webhelp/images/SongKong64.jpg
Exec=/home/mech-one/Downloads/songkong/songkong.sh
Terminal=false
Categories=Utility;
StartupNotify=true

Use your actual absolute path - I just now tested this but kept in in my Downloads folder since I've not intention of keeping the application...
You may also prefer to save the .desktop file in ~/.local/share/applications

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libc6-i386 is already the newest version (2.31-0ubuntu9.9).
libc6-i386 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

*I actually tried it multiple times, both ways before even coming here :rofl:

*That's where my only created/working .desktop link was placed. If this fixes my problem, where should I install the .desktop file if I want it to also appear in the Super menu and usable by all users?

/usr/share/applications

You will need to elevate to root to do so.

Thanks! I wanted to be sure, but thought as much after trying to understand how themes work.

Easily done with a single right click now that I've upgraded to Nemo. After all, he was the captain... :joy_cat: :nerd_face:

Sadly, none of this worked. No icon, no launch, nothing. I remembered to chmod +x on the .desktop file as well, then moved to usr/share/applications. Showed in the Super menu, but would not launch.

u can try doing that with the gui way: with menu editor(menulibre), and don't forget to fill the field of the path or working directory

@eid Thanks! I will look into it.

  1. Have you done this yourself to create a link to anything?

  2. Does it work on .sh programs located in places other than the Downloads or Desktop locations?

  3. Will it also place the link on my Super menu?

I realize I could probably install it and tweak/test it myself, but if it's not what I'm looking for then I want to avoid downloading/installing additional ways to make Ubuntu/Zorin do what I want - at least for the next hour...

I use zorin lite , so I have menu editor(menulibre) by default, I have done that before with programs located in places other than the downloads or desktop locations and that place the link on my super menu in zorin lite, but I don't try that with app.sh

I think u just need to add path field under exec field in your .desktop(path=/home/mech-one/Downloads/songkong), but if that not worked , u can try the gui way

1 Like

My Man Emoji GIF by SportsManias

It works! Launched. The icon still didn't appear for some reason with the image not being inside the same folder as the executable. But thanks to @Aravisian letting me know about the manual/GUI icon change method in File Properties. Followed by Alt+F2, r to restart desktop. Which I did to begin with, then just figured it might work if I copied the image to the same folder which the executable was in, and which the desktop was now pointing toward as Path=.
If anyone cares. Please see newly revised .desktop file:

[Desktop Entry]
Name=songkong
Path=/home/aj/songkong
Icon=/home/aj/songkong/webhelp/SongKong64.jpg
Exec=/home/aj/songkong/songkong.sh
Terminal=false
Type=Application
Categories=Audio;Video;Player;Organization;Music
MimeType=application/ogg;application/x-ogg;audio/ogg;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/ogg;video/x-ogm;video/x-ogm+ogg;video/x-theora+ogg;video/x-theora;audio/x-speex;audio/opus;application/x-flac;audio/flac;audio/x-flac;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;video/x-ms-asf;video/x-ms-asf-plugin;video/x-ms-asx;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-msvideo;audio/x-pn-windows-acm;video/divx;video/msvideo;video/vnd.divx;video/avi;video/x-avi;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/vnd.rn-realaudio;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;audio/x-real-audio;audio/x-realaudio;video/vnd.rn-realvideo;audio/mpeg;audio/mpg;audio/mp1;audio/mp2;audio/mp3;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpeg;audio/x-mpg;video/mp2t;video/mpeg;video/mpeg-system;video/x-mpeg;video/x-mpeg2;video/x-mpeg-system;application/mpeg4-iod;application/mpeg4-muxcodetable;application/x-extension-m4a;application/x-extension-mp4;audio/aac;audio/m4a;audio/mp4;audio/x-m4a;audio/x-aac;video/mp4;video/mp4v-es;video/x-m4v;application/x-quicktime-media-link;application/x-quicktimeplayer;video/quicktime;application/x-matroska;audio/x-matroska;video/x-matroska;video/webm;audio/webm;audio/3gpp;audio/3gpp2;audio/AMR;audio/AMR-WB;video/3gp;video/3gpp;video/3gpp2;x-scheme-handler/mms;x-scheme-handler/mmsh;x-scheme-handler/rtsp;x-scheme-handler/rtp;x-scheme-handler/rtmp;x-scheme-handler/icy;x-scheme-handler/icyx;application/x-cd-image;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;application/ram;application/xspf+xml;audio/mpegurl;audio/x-mpegurl;audio/scpls;audio/x-scpls;text/google-video-pointer;text/x-google-video-pointer;video/vnd.mpegurl;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.ms-wpl;application/sdp;audio/dv;video/dv;audio/x-aiff;audio/x-pn-aiff;video/x-anim;video/x-nsv;video/fli;video/flv;video/x-flc;video/x-fli;video/x-flv;audio/wav;audio/x-pn-au;audio/x-pn-wav;audio/x-wav;audio/x-adpcm;audio/ac3;audio/eac3;audio/vnd.dts;audio/vnd.dts.hd;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/vnd.dolby.mlp;audio/basic;audio/midi;audio/x-ape;audio/x-gsm;audio/x-musepack;audio/x-tta;audio/x-wavpack;audio/x-shorten;application/x-shockwave-flash;application/x-flash-video;misc/ultravox;image/vnd.rn-realpix;audio/x-it;audio/x-mod;audio/x-s3m;audio/x-xm;application/mxf;
X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
Keywords=Player;Capture;Audio;Video;Server;Music;Organize
1 Like

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