I am creating Xampp desktop launcher on my Linux Mint 19 and I have very interesting problem.
When I run this from terminal:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /opt/lampp/manager-linux-x64.run &
everything works correctly, XAMPP control panel opens.
But when I have launcher (I want to create icon for desktop) with code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=Start or Stop XAMPP
Name=XAMPP Control Panel
Exec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sudo /opt/lampp/manager-linux-x64.run
Icon[en_US]=/usr/share/icons/Humanity/devices/24/network-wired.svg
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
It prompts me for password but the window never opens. I tried various scripts and this one works in launcher:
#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=Start or Stop XAMPP
Name=XAMPP Control Panel
Exec=**sudo /opt/lampp/manager-linux-x64.run**
Icon[en_US]=/usr/share/icons/Humanity/devices/24/network-wired.svg
Encoding=UTF-8
Terminal=**true**
Name[en_US]=XAMPP Control Panel
Comment[en_US]=Start or Stop XAMPP
Type=Application
Icon=/opt/lampp/htdocs/favicon.ico
XAMPP control panel window opens but also the terminal that started it.
How can I create launcher that only opens the XAMPP control panel window without additional terminal?
.desktop
file work as expected if you remove the&
from the command? Like this:Exec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sudo /opt/lampp/manager-linux-x64.run
Exec=
defines an executable, it's not a shell interpreter. Usesh -c "blabla"
, if you wanna use shell.sh -c "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sudo /opt/lampp/manager-linux-x64.run"