selwynorren
Posts: 63
Joined: Sat Aug 06, 2016 1:30 am

Xampp .desktop launcher

Wed Sep 28, 2016 1:21 pm

Hey All,

Could someone please advise on how to resolve this small UI problem I have. I have installed and run xampp and it works very well according to the post found on Google+ However when I created the Menu launcher it uses the terminal window to request the sudo user privileges

Code: Select all

[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
Obviously if I change the terminal entry to false or leave it blank, then the app will not run, however I do know that there is a GUI way of entering the password, instead of the terminal way.

How would I go about this?

Thanks so much

Espionage724
Posts: 20
Joined: Sat Sep 17, 2016 8:42 pm

Re: Xampp .desktop launcher

Wed Sep 28, 2016 2:31 pm

selwynorren wrote:...however I do know that there is a GUI way of entering the password, instead of the terminal way.

How would I go about this?
Is pkexec what you're looking for?

User avatar
Justin
Development Team
Posts: 3617
Joined: Mon Jul 28, 2014 10:42 am
Location: Adelaide, Australia
Contact: Website Google+ Twitter

Re: Xampp .desktop launcher

Sat Oct 01, 2016 1:33 am

Indeed pkexec should work but you may need to setup files for it.

selwynorren
Posts: 63
Joined: Sat Aug 06, 2016 1:30 am

Re: Xampp .desktop launcher

Thu Oct 06, 2016 1:31 pm

Thanks guys,

Would that mean I can remove the Terminal-true line and replace sudo with pkexec?

selwynorren
Posts: 63
Joined: Sat Aug 06, 2016 1:30 am

Re: Xampp .desktop launcher

Tue Oct 18, 2016 11:09 pm

I have tried every option that fails so far yet I cant succeed, any ideas?

sunnyflunk
Development Team
Posts: 2977
Joined: Sun Mar 13, 2016 11:35 pm

Re: Xampp .desktop launcher

Wed Oct 19, 2016 1:47 am

selwynorren wrote:I have tried every option that fails so far yet I cant succeed, any ideas?
I don't know exactly how it works. But the one program that I know uses it is gparted. And example file is here https://git.solus-project.com/packages/ ... kit.policy

That file is installed here /usr/share/polkit-1/actions/com.solus_project.pkexec.gparted.policy

selwynorren
Posts: 63
Joined: Sat Aug 06, 2016 1:30 am

Re: Xampp .desktop launcher

Fri Oct 21, 2016 5:57 am

Hey there,

Yeah I found that as well, thanks so much. However if I run

Code: Select all

pkexec '/opt/lampp/manager-linux-x64.run'
from a terminal window, it works perfectly, but if I enter the same command in the desktop launcher, then it just does not run, unless I reactivate teh terminal=true option. This is where I am stuck :shock: :lol: :lol:

rafa
Posts: 2
Joined: Mon Jul 02, 2018 3:15 am

Re: Xampp .desktop launcher

Wed Jul 04, 2018 6:54 pm

I know we're in 2018, but to run XAMPP with pkexec, your polkit is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> <policyconfig> <action id="com.ubuntu.pkexec.xampp.policy"> <message>Authentication is required to run XAMP Control Panel</message> <icon_name>xampp</icon_name> <defaults> <allow_any>auth_admin</allow_any> <allow_inactive>auth_admin</allow_inactive> <allow_active>auth_admin</allow_active> </defaults> <annotate key="org.freedesktop.policykit.exec.path">/opt/lampp/manager-linux-x64.run</annotate> <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> </action> </policyconfig>
Create the file in

Code: Select all

/usr/share/polkit-1/actions/
with name

Code: Select all

com.ubuntu.pkexec.xampp.policy

Return to “Tutorials”