Ubuntu – How to set up desktop shortcuts in KDE to run terminal commands

bashcommand linedesktopkdescripts

I am trying to make a desktop shortcut to launch Spyder, which can be launched by typing spyder in terminal.

I made a spy.sh script with spyder in it. It works with bash spy.sh and ./spy.sh. But when I make a desktop shortcut like this:

[Desktop Entry]
Name=spyd
Exec=/Desktop/spy.sh
Comment=
Icon=
Type=Application
Terminal=true

It gives out an error:

"There was an error creating child process for the terminal. Failed to
execute child process “/Desktop/spy.sh” (No such file or directory)"

Same error when I change into Exec=spyder

What should I do?

Best Answer

You don't need a script to do that, in a terminal just do

$ which spyder

This gives you the full path to the file that's executed, I suppose /usr/bin/spyder. Then just use that path for your Exec= line.

Exec=/usr/bin/spyder
Related Question