Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Thunar open as root

User avatar
brolly
Forum Novice
Forum  Novice
Posts: 95
Joined: Sat Jun 22, 2019 8:26 am

Thunar open as root

#1

Post by brolly » Sat Jul 06, 2019 6:00 am

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: 1853
Joined: Tue Jan 08, 2019 4:47 am

Re: Thunar open as root

#2

Post by JayM » 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.
Please read How To Ask For Help and How to Break Your System.
MX User Manual: hold down ALT and press F1. Further information may be found in the MX Wiki.

User avatar
brolly
Forum Novice
Forum  Novice
Posts: 95
Joined: Sat Jun 22, 2019 8:26 am

Re: Thunar open as root

#3

Post by brolly » Sat Jul 06, 2019 6:36 am

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
Forum Regular
Forum Regular
Posts: 1763
Joined: Sat Jun 30, 2018 6:33 pm

Re: Thunar open as root

#4

Post by manyroads » Sat Jul 06, 2019 10:28 am

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 - http://many-roads.com
bspwm MX-18.3 kernel: 5.1.11-antix.1-amd64-smp
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Testing: Obarun, ArchLabs, antiX19

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

Re: Thunar open as root

#5

Post by dolphin_oracle » Sat Jul 06, 2019 11:32 am

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 T530 - MX-18.3
lenovo s21e - antiX-19 beta 2 (live-USB)
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
towwire
Forum Regular
Forum Regular
Posts: 564
Joined: Fri Oct 15, 2010 12:15 pm

Re: Thunar open as root

#6

Post by towwire » Sat Jul 06, 2019 12:33 pm

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
Normal people think "If it ain't broke, don't fix it".
Engineers think "If it ain't broke, it doesn't have enough features yet".

User avatar
ChrisUK
Forum Regular
Forum Regular
Posts: 312
Joined: Tue Dec 12, 2017 1:04 pm

Re: Thunar open as root

#7

Post by ChrisUK » Sat Jul 06, 2019 3:01 pm

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 - Manjaro

User avatar
manyroads
Forum Regular
Forum Regular
Posts: 1763
Joined: Sat Jun 30, 2018 6:33 pm

Re: Thunar open as root

#8

Post by manyroads » Sat Jul 06, 2019 6:51 pm

Thanks all... I truly appreciate the headsup on sudo vs. gksudo.
Pax vobiscum,
Mark Rabideau - http://many-roads.com
bspwm MX-18.3 kernel: 5.1.11-antix.1-amd64-smp
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Testing: Obarun, ArchLabs, antiX19

KoO
Forum Regular
Forum Regular
Posts: 535
Joined: Fri Feb 10, 2017 1:21 am

Re: Thunar open as root

#9

Post by KoO » Sun Jul 14, 2019 12:16 am

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 : Debian10 (i3) , Liquorix , Intel Xeon E3-1241 v3 , 16gb , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Debian10 antiX17 (i3) , 4.19.170 , i5 , 8gb . BiosMod 1.46

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

Re: Thunar open as root

#10

Post by JayM » Sun Jul 14, 2019 12:39 am

Thunar in MX already comes with "Open Root Thunar Here".
Please read How To Ask For Help and How to Break Your System.
MX User Manual: hold down ALT and press F1. Further information may be found in the MX Wiki.

Post Reply

Return to “antiX”