I did the following procedures to create a application launcher but it doesn't work.
-
create shell script named
shell.sh
with the following content:java -jar foo.jar
- Added execution permission:
sudo chmod +x shell.sh
-
Created .desktop file in
/usr/share/applications/
with the content:[Desktop Entry] Name=foo Terminal=false Exec=/path/shell.sh Type=Application Icon=/path/icon.png Categories=Utility;
Then I have an application with icon, but it couldn't run, while double click shell.sh works. What's wrong?
Best Answer
Here are some tips that can help you solve your problem:
Exec=/path/shell.sh
withExec=sh /path/shell.sh
orExec=bash /path/shell.sh
Add execution permission to the .desktop file
Also unless you want that launcher to be available system-wide (ie: to all users) you can place the .desktop file in
~/.local/share/applications
. As that folder is located in your home folder you don't needsudo
to create/edit the file.