I have XAMPP installed, it is a PHP/MySQL environment and has a control panel which can be launched using this command:

sudo /opt/lampp/manager-linux-x64.run

That works.

I want to create a launcher shortcut so it appears in 'Show Applications > All Applications' and in the dock.

In Ubuntu 16.04 Unity I did this using a launcher file in the share/applications folder and worked fine.

I only seem to find instruction on adding this as a 'desktop shortcut' with 18.04, see: https://linuxconfig.org/how-to-create-desktop-shortcut-launcher-on-ubuntu-18-04-bionic-beaver-linux

I have attempted a desktop launcher with this code:

[Desktop Entry]
Exec=sudo /opt/lampp/manager-linux-x64.run

This creates a file on the desktop, I have set to run as an application in the file properties, upon running it asks if this should be trusted to which I confirm (on a side note - is there a list of these somewhere?) but it does not run.

All the other questions related to this are attempting to use gksudo (which is deprecated in 18.04), sudo -H nautilus or pkexec, which doesn't even run via terminal, this returns:

pkexec env DISPLAY=1 XAUTHORITY=$XAUTHROTIY /opt/lampp/manager-linux-x64.run
Unknown Error couldn't connect to display "1"

Advise is to use the gvfs admin back end, this is available from Ubuntu 17.10 onwards.
Change your exec line to be:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.