Create Launcher Icon to Run As Administrator - Printable Version +- Linux Lite Forums (https://www.freecinema2022.gq/forums) +-- Forum: Software - Support (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=5) +--- Forum: Other (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=20) +--- Thread: Create Launcher Icon to Run As Administrator (/showthread.php?tid=5627) |
Create Launcher Icon to Run As Administrator - idResponse - 09-27-2018 I want to create a launcher for projectM that automatically runs it as SU. Currently, I can right click on the icon and select "Run as Administrator" and it works. I would like to be able to bypass that and just be able to doubleclick to open it. Can't seem to find how this works anywhere... Thanks! Re: Create Launcher Icon to Run As Administrator - bitsnpcs - 09-27-2018 Hello idResponse, there is a tutorial of how to do this here - https://askubuntu.com/questions/118822/how-to-launch-application-as-root-from-unity-launcher Re: Create Launcher Icon to Run As Administrator - jack action - 11-27-2018 As a new user of LL, I've been tackling with a similar problem for a long time now. First, you won't be able to run as administrator without entering the administrator password. It would violate the security protocol. You're either an administrator or you're not. And the reason I wanted to respond to this thread is because gksudo, as suggested in the tutorial, was not working for me and is also deprecated (ref.: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892768). The actual method used in LL is: Code: pkexec thunar [filename] You can verify this by opening the file manager (i.e., open any directory). These windows are managed by the program Thunar. On this window menu, select Edit -> Configure custom actions...; The window Custom Actions will appear. These are all the definitions for the items appearing in the right-click menu in Thunar (ref.: https://linuxliteos.com/manual/install.html#secureerase). You can select Open as Administrator and click Edit (the slanted pencil on the left). The window Edit action will appear. On the line Command, you can find the code I previously presented. I used this code for the command box when I wanted to add items in 'Menu' (found in the panel) with the Menu Editor (MenuLibre) to run programs as an Administrator. Creating a Launcher that opens as administrator
As an example, I created a Launcher for XAMPP. The instructions ask me to execute the following code on the command line (ref.: How do I start XAMPP?): Code: cd /opt/lampp With my installation, I actually had the file /opt/lampp/manager-linux-x64.run. So I used this command for my Launcher: Code: pkexec thunar /opt/lampp/manager-linux-x64.run pkexec opens a graphical interface to get the administrator's password and then runs the program thunar as the administrator and asks thunar to execute the given file. |