How to add custom action to open folder as root to Thunar?

It appears that this is indeed possible. Following are specific instructions to add such an action, taken from the Xfce site.

Opening a root Thunar
Name: Open a root Thunar here
Command: gksu thunar %f
File pattern: *
Appears if selection contains: Directories


As of 18.04 gksu is no longer even included in the default repositories. The recommended way to do this now is as follows:

Name: Open as admin
Command: thunar admin://%f
File pattern: *
Appears if selection contains: Directories

Weirdly though, Polkit will sometimes ask for the password twice when you first use this command. The elevated privileges seem to persist for several minutes so you won't be asked for the password again if you use the command several times in a short space of time.

Be aware that this isn't true root. You can modify or delete any files that would require root privileges via this method, however any files you create will just have your default user permissions.

Tags:

Root

Thunar