Filemanager in gnome

Ah... that's right... Gnome removed that functionality, though it remains in Thunar, Nemo, Dolphin and everywhere else.

Gnome cares not one bit about accessibility and functionaility.

I did wonder when I made the post how the ZorinGroup would overlook that... I see that they didn't.

Can't it be changed in a css file of nautilus?

Edit: I've read that nautilus is gtk4 which uses libadwaita and doesn't support theming. What a pity!

The css file can only effect a change on a widget - it cannot insert a widget. That widget (gtkinfobar) was removed in Nautilus.

I can think of some workarounds.
One is to create a Root Theme and a User theme. In the root one, change some other widget; like headerbar.titlebar or .sidebar - whatever you like, to have a different color to show you are in root.
That way if you elevate to root, when the root instance of Nautilus uses that root theme - it shows up.

The other ideas I can think of are more environment and injection variable - which are less elegant than using a system theme to relay information. I mean... that is what the theme and styling are for: Accessibility and improving workflow.
They are not about Brand Image.

1 Like

For thunar, I followed the instructions on

and set this command to open thunar as root from the current location:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY dbus-launch thunar %f
I tried replacing thunar with nautilus, but that doesn't work.
At the moment I have set the command pkexec nautilus for nautilus, that works, but then nautilus does not open at the location where I am, but in root's home directory.

How can I change the command so that nautilus opens the current directory/folder as root?

Nautilus will ignore the %f if it does not have a target directory.
I am not sure a single launch command will work, since you need to specify if you are targeting a file or a directory, and if no argument is given, how it will fallback. If no argument, it will launch in Root home, rather than your current directory.
You might try:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS nautilus %d

That should keep you in your current directory.

Nothing opens with this command despite entering requested password.

Are you using Zorin OS 17 or 18 β?

In Gnome, it will block root access in the later versions...

As a test; in terminal see what this outputs:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY nautilus --no-desktop "$(pwd)"

(If using Wayland, XAUTHORITY will be ignored).

Zorin 17.3 lite with Zorin (gnome) desktop running on XOrg. I've just shut down the notebook and am calling it a day. I'll have another look tomorrow. Thanks for your help!

I'm wondering if the command at the github example "Open a terminal as root in a specific folder" maybe can be adapted so that not also a terminal is opened, or if dbus-x11 is needed.

This is the command there:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gnome-terminal -t \"ROOT: %f\" \"--working-directory=%f\""

Shall I try this command without "gnome-terminal -t"

The output of your command

was
"Config file /root/.local/share/actions-for-nautilus/config.json does not exist"

There was a password request and then nautilus was opened as root in my user's home directory.

I've added an configuration example of github to my post #47. Shall I try a similar command?

So not blocked, that did work.

The message about a file not existing only meant that it checked if you had a -er-user configuration file for access. Since you do not, it relayed that none exists.

Have you yet run

sudo apt install nautilus-admin

killall nautilus

Then launched Nautilus to check if the Right Click context menu includes "open as admin" for directories and "Edit as admin" for files?

It is installed and I can choose it in my context menu (I have two entries there: open as admin, that is the default one of gnome, and open as admin 2, which is my json). But it uses gvfsd and I don't like it because there are further password requests when I want to edit files or switch to another file that needs root rights and open it. Thunar and nemo don't show this behavior when I use the integrated open as admin function. So they use other authentication services and I want to find out if I can use them in nautilus, too. I like to explore that.

Ah!. Yes, you had mentioned this already. I needed to catch up in the thread...
Off the top of my head, I am not sure of a neat solution; I would need to look into it further. But, what I do know is that Thunar is User Forgiving in the direct call whereas Nautilus is quite strict.
This strictness is about controlling the end user due to the presumption that most users cannot handle access to Root. But it is easy to act on simply by labeling it as a Security Feature. It cannot be simply bypassed without patching Nautilus, compiling it and then installing your compiled version. Instead, you could write a script that handles Nautilus as admin. But, that too, I would need to look into...

I think I'm close to nautilus behaving like the other filemanagers. The only thing missing is a small change to make it so that nautilus does not start in its home directory if you are already in the directory of the file you want to edit. It doesn't matter if there is no (simple) solution for this. I enjoy exploring it.
However, since it is so complicated, I would advise the vast majority of users not to do my steps and save themselves the trouble, but to switch to nemo instead.
It seems to me that many moderators/experienced users here don't use nautilus because out of the box it doesn't offer the same features as other file managers.

I'm not sure if I've already tried with
pkexec nautilus %f
and will test this.

pkexec nautilus %f

solved it and now nautilus opens as root at the current location when I'm in nautilus and right-click and choose open as admin 2. Problem solved😀

Just one password prompt for all tasks - much better than the gnome gvfsd-admin!

I summarize what I did:

I created a new rule in polkit

sudo nano /usr/share/polkit-1/actions/nautilus-root.policy

…and inside, copied:

    <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
     <policyconfig>
       <action id="org.freedesktop.policykit.pkexec.run-nautilus">
         <description>Run Nautilus As Admin</description>
         <message>Authentication is required to run Nautilus As Admin</message>
         <defaults>
           <allow_any>no</allow_any>
           <allow_inactive>no</allow_inactive>
           <allow_active>auth_admin_keep</allow_active>
         </defaults>
         <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/nautilus</annotate>
         <annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
       </action>
     </policyconfig>

Then, to run nautilus as root:

pkexec nautilus

To have this function in context menu of nautilus I downloaded and installed the .deb file of bassmanitram actions-for- nautilus

and then setup my own action as JSON with the label "open as admin 2" (you can choose any name) and the command "pkexec nautilus %f".

I have an entry in my context menu of nautilus and I don´t know where it comes from. How do I get rid of "Folder´s Color"? Nothing happens when I select it. I think it was contained in the json configuration examples but I deleted all except of my own created action and this one is still there. It is not shown in JSON file.

That comes by default. With that You can change Folder Colors. You see the Arrow at the Side?


There you can change it.

Looks I've missed quite a few messages, but I'm glad you got it sorted out.

This comes from folder-color package, you can just uninstall it:

sudo apt remove folder-color

I suspect the reason nothing happens is because of the language. This doesn't actually change the color of the folder, it just picks an image file to use instead of the default icon theme. I don't think those are translated to every language and it probably can't find the correct file in German. Try with Cyan or Orange, as those are the same, do they work?

That works in German, too:

But it depends on the used Icon Theme. With the Zorin Icons it isn't a Problem.

Mmm, yeah it must be the combination of icon set + language. Do other colors with a different name from English work, like Blau?