Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 7499  / 2 Years ago, wed, august 10, 2022, 7:17:17

I did the following procedures to create a application launcher but it doesn't work.




  1. create shell script named shell.sh with the following content:



    java -jar foo.jar

  2. Added execution permission: sudo chmod +x shell.sh

  3. 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?


More From » scripts

 Answers
2

Here are some tips that can help you solve your problem:




  1. Replace Exec=/path/shell.sh with Exec=sh /path/shell.sh or Exec=bash /path/shell.sh

  2. Add execution permission to the .desktop file



    sudo chmod +x /usr/share/application/<your_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 need sudo to create/edit the file.


[#33620] Wednesday, August 10, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ingsta

Total Points: 391
Total Questions: 103
Total Answers: 124

Location: Bonaire
Member since Wed, Mar 29, 2023
1 Year ago
ingsta questions
Sun, Oct 23, 22, 01:42, 2 Years ago
Sat, Oct 30, 21, 11:27, 3 Years ago
Sun, Nov 28, 21, 12:49, 2 Years ago
;