How to add custom action to open folder as root to Thunar?
Solution 1
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
Solution 2
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.
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
Thunar has an option to add context menu custom actions to open Terminal, or to open folders and files in different applications.
Could it be possible to add a menu custom action that would open Thunar itself as root?
-
Admin over 10 yearsis there a way that change is so that i can open nearly anthing as root?
-
dez93_2000 over 9 yearsWould there be a reason why this doesn't work? Neither this nor "edit folder as root" do anything for me... nothing opens or happens...
-
dez93_2000 over 8 yearsto add: gksu not installed by default in xubuntu, sudo is. "sudo thunar %f" doesn't work, presumably because there's no way to pass the password to it. "thunar %f" works. You have to right-click a folder.
-
Quidam about 4 yearsThank you! I read in a tuto to make "sudo..." instead of gksu for shortcut launchers, but it wasn't working. This one really works.
-
ThunderBird over 2 yearsThis does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
-
Painkiller over 2 yearssorry @ThunderBird but i do not see any problem with my answer. If i did something wrong i can remove my answer