Created .desktop launcher is not working in Ubuntu 19.04
Solution 1
Your desktop file should look something like this:
[Desktop Entry]
Version=1.0
Name=Todoist
Exec=bash -c 'cd ~/todoist-linux-1.17 && make up'
Terminal=true
Type=Application
Categories=Application;
You can also set terminal=false
and replace Exec=bash -c 'cd ~/todoist-linux-1.17 && make up'
with Exec=gnome-terminal -e "bash -c 'cd ~/todoist-linux-1.17 && make up'"
to run this in gnome terminal.
Solution 2
You need to create a bash script for the command you want to run and the point the Exec=
entry to the script.
First create a simple script, i.e. a text file, say a file named myscript
in your Documents folder with the following text
#!/bin/bash
cd ~/todoist-linux-1.17 && make up
and make it executable. Then modify your .desktop
launcher and for the Exec
entry use the following
Exec=/home/YOUR-USERNAME/Documents/myscript
(you need to use absolute paths in the .desktop
file).
Related videos on Youtube
![Viktor](https://lh3.googleusercontent.com/-UdfNRs43AEc/AAAAAAAAAAI/AAAAAAAAAZ0/b4smhVOBuPE/photo.jpg?sz=256)
Viktor
Updated on September 18, 2022Comments
-
Viktor almost 2 years
I wanted to create a shortcut to run a command which will move to a directory and run a command. The problem is that when double-click the launcher, it doesn't do anything. I set check "Allow execute as a programm". This is how my .desktop file looks like
[Desktop Entry] Version=1.0 Type=Application Terminal=true Exec=cd ~/todoist-linux-1.17 && make up Name=Todoist Icon=
-
Viktor almost 5 yearsstill, it doesn't run, I included a screenshot of how this shortcut looks like, maybe it is being run with the incorrect application?
-
pomsky almost 5 years@Viktor You haven't mentioned in the question, but now from the screenshot it looks like you have placed the
.desktop
file in your Desktop. On Ubuntu 19.04, Nautilus (file-manager) does not handle desktop icons, they're provided by a GNOME extension. Currently the extension provides only a limited number of features. Place the.desktop
file in some other folder and try. If it works, put the.desktop
file in your~/.local/share/applications/
folder. Then you would be able to search and launch it from the 'Activities' overview or 'Show Applications' screen. -
Viktor almost 5 yearsThank you for your help, now it has a preloader but it doesn't execute the script, if i did everything correctly, i created todoist.sh script inside Document put the
.desktop
file in the same place and put the full path to scriptExec=/home/viktor/Documents/todoist
as well tried withtodoist.sh
-
pomsky almost 5 yearsDoes just running the command in Terminal work? Not sure what's specific about this command, I tried with some generic and basic commands, it works okay.
-
Viktor almost 5 yearsyes i runned the command separetly and it worked
-
pomsky almost 5 yearsNot sure what's going wrong here, sorry :( Just to make sure, is your system language English?
-
vanadium almost 5 yearsI consider the answer of Synchro as the simplest and more straighforward approach here, but unfortunatelly there are other issues with that anwer.
-
Viktor almost 5 yearsi noticed that launcher is not working at all no matter what kind of command i put