Hi Team,
Since PCManFM does not have open folder as root by default.
Created a desktop file with below content in path - /home/guest/.local/share/file-manager/actions
This prompted for root pass and will open folder as Root.
Don't know if this has any security issues (helps me a lot - Read on internet like this was removed due to seucurity issues - don't know what is that)
[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=/opt/porteus-scripts/xorg/psu /usr/bin/pcmanfm %u
Name=Default profile
Open Folder as Root - PCManFM
- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Open Folder as Root - PCManFM
thanks,
will be included in the next release, with one small difference:
for there seems to be an advantage in having a dbus connection..

Code: Select all
Exec=/opt/porteus-scripts/xorg/psu dbus-run-session /usr/bin/pcmanfm %u
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Open Folder as Root - PCManFM
Ohh dbus advantages I didn't know yet. Let me check out.
By the way ncmprhnsbl one more thing "open as root" is still coming for all file types as well in context menu even though i put "inode/directory" in Mimetypes.
dont know why

By the way ncmprhnsbl one more thing "open as root" is still coming for all file types as well in context menu even though i put "inode/directory" in Mimetypes.
dont know why

- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Open Folder as Root - PCManFM
ok.. had another look at this.. not sure how to fix that with the pcmanfm actions approach.. but:
there's the existing ~/.local/share/applications/pcmanfm-root.desktop file
all that needs to be done is run: update-desktop-database ~/.local/share/applications/
which will create: ~/.local/share/applications/mimeinfo.cache with contents:
(you can just create that manually with same effect)
anyway, this will get the root filemanager entry to appear in the right-click menu for directories .. just a little higher up..
there's the existing ~/.local/share/applications/pcmanfm-root.desktop file
all that needs to be done is run: update-desktop-database ~/.local/share/applications/
which will create: ~/.local/share/applications/mimeinfo.cache with contents:
Code: Select all
[MIME Cache]
inode/directory=pcmanfm-root.desktop
anyway, this will get the root filemanager entry to appear in the right-click menu for directories .. just a little higher up..
Last edited by ncmprhnsbl on 10 Apr 2022, 01:29, edited 1 time in total.
Reason: fixed typo: pcmanfm-root-desktop> pcmanfm-root.desktop
Reason: fixed typo: pcmanfm-root-desktop> pcmanfm-root.desktop
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Open Folder as Root - PCManFM
This is working. Great findings @ncmprhnsblncmprhnsbl wrote: ↑09 Apr 2022, 13:34ok.. had another look at this.. not sure how to fix that with the pcmanfm actions approach.. but:
there's the existing ~/.local/share/applications/pcmanfm-root.desktop file
all that needs to be done is run: update-desktop-database ~/.local/share/applications/
which will create: ~/.local/share/applications/mimeinfo.cache with contents:(you can just create that manually with same effect)Code: Select all
[MIME Cache] inode/directory=pcmanfm-root-desktop
anyway, this will get the root filemanager entry to appear in the right-click menu for directories .. just a little higher up..
Also it would be grateful if you could tell me the advantage in having a dbus connection


- ncmprhnsbl
- DEV Team
- Posts: 4253
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Open Folder as Root - PCManFM
it's mainly so that the mounted devices shown in the side panel of the root instance don't show extra 'nonesense' entries like 'pts', 'dev' etc..
and also in eg. in an editor spawned from the root instance of pcmanfm, these extra entries will appear in the 'save as' or 'open' dialogs..
..also, i fixed a typo in my previous post: pcmanfm-root-desktop should have been pcmanfm-root.desktop
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Open Folder as Root - PCManFM
Hi ncmprhnsbl,
Thanks much for letting me know.
So changed the entry like this.
Tooltip=Open as Root
Name=Open as Root

Thanks much for letting me know.

Found why the above is happening. With the action entry in context menu we can open folder and any file as root, the settings is for file-manager and thus it is showing for all files and folder in PcManFM.
So changed the entry like this.
Tooltip=Open as Root
Name=Open as Root

Open Folder as Root - PCManFM
Huh, I'll have to check this out, since when I need a root version of pcmanfm I just lazy it up either in the root terminal, or sudo to it
sudo pcmanfm
A couple warnings about GTK pixelbufs show up, but I can still operate. I do the same with engrampa archive manager firing it up from a root terminal and need to extract to a location that as guest, won't let me do..
Your examples show a longer-term solution however..
sudo pcmanfm
A couple warnings about GTK pixelbufs show up, but I can still operate. I do the same with engrampa archive manager firing it up from a root terminal and need to extract to a location that as guest, won't let me do..
Your examples show a longer-term solution however..
That's a UNIX book - cool. -Garth