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/bugrepor...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
- Click 'Menu' on the desktop panel;
- Type 'menu' in the search bar. The program Menu Editor should appear in the available choices above, click on it;
- In the window that appeared, in the left panel, select the directory you wish to install your Launcher;
- Click the '+' sign in the top menu and select Add Launcher;
- On the right panel, you can click on the icon, the title ('New Launcher') and the description ('A small descriptive blurb about this application.') to modify them;
- On the command box, type the code pkexec thunar [filename], where [filename] is the filename (with the full path) of the desired file;
- Click Save Launcher (the down arrow) in the top menu.
Your new launcher is now in the 'Menu' of the desktop panel (in the directory you chose).
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
sudo ./manager-linux.run (or manager-linux-x64.run)
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.