Thunar open as root

Message
Author
User avatar
brolly
Posts: 82
Joined: Sat Jun 22, 2019 8:26 am

Thunar open as root

#1 Post by brolly »

Hi guys


I'm sure this question has been asked a few times. If not, I am trying to work out how to activate "open as root" in right click thunar" in antix 19 beta. If it's not doable, is it possible to add a nautilus command in the right click context menu. If so please assist in how i can add the command. Many thanks.

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Thunar open as root

#2 Post by JayM »

I hope someone can answer this because just this afternoon I had to open a terminal in antiX 19b1 and run sudo spacefm to get a root file manager (I haven't installed Xfce.) So I'd also like to know.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
brolly
Posts: 82
Joined: Sat Jun 22, 2019 8:26 am

Re: Thunar open as root

#3 Post by brolly »

JayM wrote: Sat Jul 06, 2019 6:09 am I hope someone can answer this because just this afternoon I had to open a terminal in antiX 19b1 and run sudo spacefm to get a root file manager (I haven't installed Xfce.) So I'd also like to know.


I followed instructions here forensically: https://docs.xfce.org/xfce/thunar/custom-actions No joy. I took into consideration that in some actions i had to replace "terminal" with "xfceterminal" and "gksu" with "pkexec". I wish some could help

User avatar
manyroads
Posts: 2603
Joined: Sat Jun 30, 2018 6:33 pm

Re: Thunar open as root

#4 Post by manyroads »

It works fine in xfce (assuming you are using Thunar) Use the following command:
sudo thunar

Here's a bunch of info on Custom Commands for Thunar:
https://eirenicon.org/knowledge-base/xf ... on-tricks/
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

User avatar
dolphin_oracle
Developer
Posts: 19921
Joined: Sun Dec 16, 2007 1:17 pm

Re: Thunar open as root

#5 Post by dolphin_oracle »

please remember that antiX uses the user's "sudo" password for most admin tasks instead of the root password like MX. so make sure you are using the correct password.

on any antiX with thunar installed,

Code: Select all

gksu thunar %f
should be all you need for a right click root thunar action.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
towwire
Posts: 645
Joined: Fri Oct 15, 2010 12:15 pm

Re: Thunar open as root

#6 Post by towwire »

I'm running MX-18.3_x64 Continuum Apr 7 2019 update from MX-17. And in thunar I have right click 'Open root Thunar here'.
Thunar Custom actions Command:

Code: Select all

gnome-keyring-daemon -r -d;gksu thunar %f
I also have the right click 'Edit as Root'.
Thunar Custom actions Command:

Code: Select all

gnome-keyring-daemon -r -d;/usr/bin/mx-edit-as-root.sh %f;
Here is mx-edit-as-root.sh file.

Code: Select all

#!/bin/bash

# fehlix 29.06.2018
# mx-edit-as-root.sh

# opens user's mime-default text-editor as root
# option -e <EDITOR> : overrides default

P=$(readlink -f $0 ) # PROG

## for option -e 
unset E
while getopts "e:" opt; do
	case $opt in
		e)  E=$OPTARG   ;; #  EDITOR
	esac
done
shift $((OPTIND-1))
# do we have default editor 
[ -z "$E" ] && { 
	MIME_DEFAULT=$(xdg-mime query default text/plain)
	E=$(sed -nE '/^Exec=/{s/Exec=//;s/\s+.*//;p;q}' 2>&- {/home/$USER/.local,/usr{/local,}}/share/applications/${MIME_DEFAULT}) 
    echo $E
}

EDITOR=$(command -v "$E") || exit
echo $EDITOR

##launch editor

su-to-root -X -c "$EDITOR $@" 2>/dev/null

exit
Maybe this helps
It is easier to fight for one's principles then to live up to them.

User avatar
ChrisUK
Qualified MX Guide
Posts: 299
Joined: Tue Dec 12, 2017 1:04 pm

Re: Thunar open as root

#7 Post by ChrisUK »

Just a note about using

Code: Select all

sudo some-gui-app
... it will likely mess up your $HOME. You'll end up with files in $HOME that are owned by root. It's easy enough to correct the permissions, but only if you know that's the cause of whatever problem you get.

Always use gksudo or gksu to launch gui apps with root permission from the command-line, that way you won't risk messing up your $HOME. Basically,

Code: Select all

sudo some-gui-app
writes to your $HOME with root permissions (rather than to /root/home) - whereas

Code: Select all

gksudo some-gui-app
writes to your $HOME with the correct permissions (owned by you)

*I'd guess the above still applies until it all switches to pkexec?

(I've rushed as usual, hopefully someone will correct anything I've got wrong or add any omissions)
Chris

MX 18 MX 19 - Manjaro

User avatar
manyroads
Posts: 2603
Joined: Sat Jun 30, 2018 6:33 pm

Re: Thunar open as root

#8 Post by manyroads »

Thanks all... I truly appreciate the headsup on sudo vs. gksudo.
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 1:21 am

Re: Thunar open as root

#9 Post by KoO »

Their is a great list of Thunar configure custom actions on the site below..
https://docs.xfce.org/xfce/thunar/custom-actions

Open a root Thunar here = gksu thunar %f Appearance Conditions= Directories

I have seen people complain their new custom actions don't work all because they forgot to add an entry in the Appearance Conditions tab..and or have not installed gksu ..
Image

Image

Hope the screenshots are not to big Sorry if this is the case..
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

Re: Thunar open as root

#10 Post by JayM »

Thunar in MX already comes with "Open Root Thunar Here".
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

Post Reply

Return to “antiX”