Last active
May 8, 2023 01:38
-
-
Save ailtonbsj/539f9a39e829c2bab730ff1eca6a06d3 to your computer and use it in GitHub Desktop.
Create a launcher for XAMPP on Lubuntu 18.04 LTS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$(id -u)" != "0" ]; then | |
echo 'need root!' | |
exit | |
fi | |
cat << EOF > /usr/share/polkit-1/actions/org.freedesktop.policykit.xampp.policy | |
<?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="org.freedesktop.policykit.pkexec.xampp"> | |
<description>Run xampp program</description> | |
<message>Authentication is required to run the xampp</message> | |
<icon_name></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> | |
EOF | |
cat << EOF > /usr/share/applications/lampp.desktop | |
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Name=Xampp | |
GenericName=Xampp | |
Comment=Apache php w mysql and ftp | |
Exec=pkexec /opt/lampp/manager-linux-x64.run | |
Categories=Development;IDE; | |
Icon=/opt/lampp/htdocs/favicon.ico | |
Terminal=false | |
StartupNotify=true | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment