open as root?
open as root?
How do I set up a menu entry to open pcmanfm as root?
Re: open as root?
Open /usr/share/applications/pcmanfm.desktop as root. Edit it to change this line:
Use "Save As" not "Save" or your entry for PCManFM will be lost.
so that it reads like this:Exec=pcmanfm %F --no-desktop
Save the file as pcmanfm superuser mode or your name of choice.Exec=gksu -l /usr/bin/pcmanfm &
Use "Save As" not "Save" or your entry for PCManFM will be lost.
Re: open as root?
Thanks Neal. I have done as you say and also changed "name" to "Root File Manager" before saving the file as pcmanfm-root, and it now shows in the menu as Root File Manager. Excellent so far! When I launch it, I get the window asking for my root password, which is accepted, but pcmanfm does not appear, although HTOP shows that it is running. This is on a vanilla install of Debian Lenny. Any ideas?
EDIT: I get the same result from the root terminal.
EDIT: I get the same result from the root terminal.
Re: open as root?
Try this:
Open leafpad or other text editor and copy the following into it -->
You can change the icons to others, if you choose. Save the file as launchasroot. There should be no need for an extension, but if there is, use .sh. Copy the file to /usr/bin (Or wherever the programs for debian are installed by default) and set its permissions. --> right click on the file, choose Properties and click on the Permissions tab. Enter into Owner and Group fields root. Then set Owner to read write and execute, Group to read and execute and Others to read and execute (this is optional).
Next create a .desktop file for this script.
You will need to install gtkdialog, if you do not have it already.
Open leafpad or other text editor and copy the following into it -->
Code: Select all
#!/bin/sh
#-------------------------------------------------------
# Start program
export launchasroot='
<window title="Root Launcher" icon="/usr/share/icons/gnome/32x32/apps/file-manager.png" window-position="2">
<vbox>
<notebook label="Launch as Root ">
<vbox>
<frame>
<hbox>
<button>
<input file>"/usr/share/icons/file_tools_section.png"</input>
<action>gksu -l /usr/bin/pcmanfm &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"File Manager Superuser Mode"</label>
</text>
</hbox>
</vbox>
</window>
'
gtkdialog --program=launchasroot
unset launchasroot
Next create a .desktop file for this script.
Set its permissions. You should now have a menu entry for this launcher.[Desktop Entry]
Name=Launch as Root
Exec=/usr/bin/launchasroot
Comment=Root Launcher
Icon=file-manager.png
Terminal=false
Type=Application
StartupNotify=true
Categories=Settings;GTK;X-MandrivaLinux-System-Configuration; (change this to match )
OnlyShowIn=LXDE;
You will need to install gtkdialog, if you do not have it already.
Re: open as root?
OK, thanks Neal, I will try that but just one question, I do not know what to put in this line:
Code: Select all
Categories=Settings;GTK;X-MandrivaLinux-System-Configuration; (change this to match )
Re: open as root?
You're welcome. Look at your file for pcmanfm. What is on that line? Copy it over.
Re: open as root?
Hi Neal
Thank you but it doesn't work for me, I have the same answer: File doesn't exist
1-Install "gtkdialog"
2- In /usr/bin create a file "launchasroot" (tested with launchasroot.sh) with your script, and set permissions for Owner and Group
3- In /home/freely create a .desktop file with the second script, edit "Categories=" for my computer and set permissions for Owner and Group
Any idea?
Thank you but it doesn't work for me, I have the same answer: File doesn't exist
1-Install "gtkdialog"
2- In /usr/bin create a file "launchasroot" (tested with launchasroot.sh) with your script, and set permissions for Owner and Group
3- In /home/freely create a .desktop file with the second script, edit "Categories=" for my computer and set permissions for Owner and Group
Any idea?
Re: open as root?
This is your problem. The .desktop file should not be in your /home directory. It should be in /usr/share/applications with your other .desktop files. Be sure to check its permissions - right click > properties > permissions tab. Compare to other .desktop files to be sure they're set correctly.FreelY wrote:Hi Neal
3- In /home/freely create a .desktop file with the second script, edit "Categories=" for my computer and set permissions for Owner and Group
Any idea?
Re: open as root?
Again the same answer
But now that's good! with "Exec=gksu /usr/bin/pcmanfm" and not "Exec=gksu -l /usr/bin/pcmanfm & " in my file pcmanfm_root.desktop
thanks
But now that's good! with "Exec=gksu /usr/bin/pcmanfm" and not "Exec=gksu -l /usr/bin/pcmanfm & " in my file pcmanfm_root.desktop
thanks
Re: open as root?
Hi Neal, not got this working yet. The program does not execute. In terminal, I get:Neal wrote:Try this:
Open leafpad or other text editor and copy the following into it -->
You can change the icons to others, if you choose. Save the file as launchasroot. There should be no need for an extension, but if there is, use .sh. Copy the file to /usr/bin (Or wherever the programs for debian are installed by default) and set its permissions. --> right click on the file, choose Properties and click on the Permissions tab. Enter into Owner and Group fields root. Then set Owner to read write and execute, Group to read and execute and Others to read and execute (this is optional).Code: Select all
#!/bin/sh #------------------------------------------------------- # Start program export launchasroot=' <window title="Root Launcher" icon="/usr/share/icons/gnome/32x32/apps/file-manager.png" window-position="2"> <vbox> <notebook label="Launch as Root "> <vbox> <frame> <hbox> <button> <input file>"/usr/share/icons/file_tools_section.png"</input> <action>gksu -l /usr/bin/pcmanfm &</action> </button> <text use-markup="true" width-chars="17"> <label>"File Manager Superuser Mode"</label> </text> </hbox> </vbox> </window> ' gtkdialog --program=launchasroot unset launchasroot
Next create a .desktop file for this script.Set its permissions. You should now have a menu entry for this launcher.[Desktop Entry]
Name=Launch as Root
Exec=/usr/bin/launchasroot
Comment=Root Launcher
Icon=file-manager.png
Terminal=false
Type=Application
StartupNotify=true
Categories=Settings;GTK;X-MandrivaLinux-System-Configuration; (change this to match )
OnlyShowIn=LXDE;
You will need to install gtkdialog, if you do not have it already.
Code: Select all
mike@acer-7520:~$ launchasroot
** ERROR **: gtkdialog: Error in line 16, near token '</vbox>': syntax error
aborting...
/usr/bin/launchasroot: line 25: 3500 Aborted gtkdialog --program=launchasroot