Open PCmanFM as Root from context menu


#1

Anyone here use PCmanFM? Want to open as Root easily? Well read on.

Disclaimer, there is no obvious indication that PCmanFM is actually open as root. Use this with extreme caution.

Also this won’t work on the later versions of AL that don’t include gksu.

If you aren’t comfortable with this, then move on and ignore

Potential System Harming Information
  • Create ./local/share/file-manager/action.
  • In that folder, create a file called “root.desktop”
  • Add the following:
[Desktop Entry]
Type=Action
Tooltip=Open Folder As Root
Name=Open Folder As Root
Profiles=profile-zero;
Icon=gtk-dialog-authentication

[X-Action-Profile profile-zero]
MimeTypes=inode/directory;
Exec=/usr/bin/gksu /usr/bin/pcmanfm %u
Name=Default profile
  • killall pcmanfm

Restart PCmanFm and voila, you should have a “open as root” entry in your context menu.

Again, for emphasis:

there is no obvious indication that PCmanFM is actually open as root. Use this with extreme caution.


#2

Thank you so much!


#3

Nice

There a pkexec equivalent of the command?

And I tried the command with the “-n” and “–new-window” options to see if that worked, but it didn’t. Any idea if “Open in new window as root” is an option?


#4

Have you tried “sudo -i”?


#5

So I discovered that this stopped working. What I did was follow the instructions here using the xsudo script.

This is what goes in ./local/share/file-manager/actions from above with this:

[Desktop Entry]
Type=Action
Tooltip=Open Folder As Root
Name=Open Folder As Root
Profiles=profile-zero;
Icon=gtk-dialog-authentication

Exec=/usr/bin/xsudo /usr/bin/pcmanfm %u

[X-Action-Profile profile-zero]
MimeTypes=inode/directory;
Exec=/usr/bin/xsudo /usr/bin/pcmanfm %u
Name=Default profile

Works a treat.


#6

Wow, thx for sharing the solution, might be useful to the community.