5

I installed a (proprietary) software in /opt and I am able to run it perfectly using command line. Then I'd like to create a desktop icon to launch it: on my Mint distro I use create_launcher.

However, when clicking on my fresh icon, nothing happens. Why?

Kusalananda
  • 333,661

5 Answers5

6

Your software installed in /opt/... is not a statically linked binary but requires some libraries which are also installed below /opt but your system does not know to search that directory for the required libraries. One way to fix this is setting the LD_LIBRARY_PATH variable to include your directory in /opt.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Bananguin
  • 7,984
  • One way to add a path to LD_LIBRARY_PATH is putting it in the "Exec" like Exec=/usr/bin/env LD_LIBRARY_PATH=/opt/theprogram/libraries/:$LD_LIBRARY_PATH /opt/theprogram/theprogramexecutable. Some times the library folder is the same of the executable. – PhoneixS Nov 26 '20 at 16:32
2

Not sure if it's applicable to all distros, but in Ubuntu 20.04, you can validate your .desktop file with desktop-file-validate </path/to/myapp.desktop>

Junaid
  • 121
1

You most probably did not specify a specific path and the binary is therefore searched using the $PATH variable.

It seems like your location "/opt/..." is contained in your shells PATH but not in your launchers path. This is probably because you set it in the config file of your shell, like .bashrc.

The easiest solution is simply specifying the complete path in your launcher, i.e. /opt/path/to/your/binary.

michas
  • 21,510
  • No, using the full path does not solve the issue –  Jan 22 '13 at 11:41
  • in fact it is not a binary, but a small script... –  Jan 22 '13 at 11:43
  • In that case it is probably started, but does not display anything, because the script itself failed for another reason. Try starting something like xlogo at the beginning of your script, to verify the script itself is started. – michas Jan 22 '13 at 11:47
  • It is possible that the script is relying on other aspects of your shell environment that is different from when it is run via the desktop launcher. Perhaps you can add a line near the top to dump the env into a file, and then diff them? – Danny Staple Jan 22 '13 at 12:37
  • If it is a script: Where should it put the output? Launching it in an x-term could work. – Bonsi Scott Jan 22 '13 at 18:39
0

Try setting the Exec path directly in your desktop file

Workaround I found calling mate-terminal directly from the launcher

Exec=mate-terminal -- path/do/your/script

You can edit your desktop file with vi. This issue had me going in circles for some time.

If you don't have mate installed you can do sudo apt install mate-terminal

Then once installed click on Edit then Profile Preferences to set the parameters like font, colors, bell, cursor, etc.

Only certain versions of Linux do this. Ubuntu does not.

Hope this helps...

0

Update

It appears this is fixed in Mint-19.2. If you leave

Exec=mate-terminal -- /path/do/your/script

You will open two terminal sessions. With 19.2 go back to

Exec=/path/do/your/script

In either case make sure the mode of the file is 755 so it's executable.