1

Really hoping someone can advise on this. I have installed xampp and it works perfectly. I have create a launcher for the app. It works as well. however I have to specify that the launcher for Xampp be used with Terminal, in order to input my password. What I would like to do is bypass the terminal input of my password, so that I can input the password in a pop up like the other apps do.

Bellow is my app launcher content

[Desktop Entry]
Encoding=UTF-8
Name=Xampp Control Panel
Comment=Start or Stop XAMPP
Exec=sudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/favicon.ico
Categories=Application;Development;Web
Version=1.0
Type=Application
Terminal=true
1

Replace sudo in the Exec line with pkexec. In the past, you could have used gksu, but it is no longer available in distros based on ubuntu 18.04.

EDIT:

So I got it working using the below .desktop file:

#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=Start or Stop XAMPP
Name=XAMPP Control Panel
Exec=sh -c "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /opt/lampp/manager-linux-x64.run"
Encoding=UTF-8
Terminal=false
Name[en_US]=XAMPP Control Panel
Comment[en_US]=Start or Stop XAMPP
Type=Application
Icon=/opt/lampp/htdocs/favicon.ico

enter image description here

| improve this answer | |
  • @Selwyn Orren I updated my answer, let me know if it works for you aswell. – Vlad Pop Oct 31 '19 at 7:40
  • Works perfectly!!! Wow thanks so, so much – Selwyn Orren Nov 1 '19 at 7:50
  • 1
    @SelwynOrren glad I could help. Have fun coding! – Vlad Pop Nov 1 '19 at 12:52
0

You don't need to use sudo permissions to execute an app stored on the /opt directory. So changing Exec=sudo /opt/lampp/manager-linux-x64.run with Exec=/opt/lampp/manager-linux-x64.run should work.

You may also need to grant ownership to the current user to that directory in case it was wrongly assigned. You can do that from terminal with sudo chown -R user /opt/lampp/, where user is your username.

| improve this answer | |
  • 1
    Howdy, thanks for that, you may not need sudo permission to run an app in /opt directory, however the xampp launcher app itself does require elevated privileges to to start the servers. Now pkexec itself kind of work in the terminal, it does not work at all in the xampp.desktop file at all. Even when using the Terminal I have to input the file like this to get it to work pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /opt/lampp/manager-linux-x64.run – Selwyn Orren Oct 25 '19 at 8:57

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.