You are not logged in.

#1 2023-05-20 08:57:11

sehlawi
Member
Registered: 2023-05-20
Posts: 2

Settings not saved in Thunar and Mousepad

Hello,

I am an old manjaro user which i have abandoned in favor of arch linux.

After a fresh installation and configuration as i need i have noticed that if i run thunar or mousepad with root privilege, the settings or the modifications that i do are not saved.

For example if i change the size of the icons in thunar or modifying the settings in mousepad that remain same as default.

Any advice is welcome, thank in advance for your help.

Offline

#2 2023-05-26 09:52:13

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: Settings not saved in Thunar and Mousepad

Hi, and welcome to the forums!

Running GUI (editor)s as root is not a sane idea (some utilize 'polkit' for privilege escalation, which is arguably a saner approach...)

What's the output of

ls -la ~/.config/{Thunar,Mousepad}

?

Last edited by dogknowsnx (2023-05-26 10:02:57)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#3 2023-05-26 20:28:53

sehlawi
Member
Registered: 2023-05-20
Posts: 2

Re: Settings not saved in Thunar and Mousepad

dogknowsnx wrote:

Running GUI (editor)s as root is not a sane idea (some utilize 'polkit' for privilege escalation, which is arguably a saner approach...)

as below

$ cat /usr/share/polkit-1/actions/org.xfce.mousepad.policy

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "https://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

 <vendor>Mousepad</vendor>
 <vendor_url>https://xfce.org/</vendor_url>
 <icon_name>org.xfce.mousepad</icon_name>

 <action id="org.xfce.mousepad">
 
 <description>Run Mousepad as root</description>

 <message>Authentication is required to run Mousepad as root.</message>

 <defaults>
 <allow_any>no</allow_any>
 <allow_inactive>auth_admin</allow_inactive>
 <allow_active>auth_admin</allow_active>
 </defaults>
 <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/mousepad</annotate>
 <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

</policyconfig>

then

pkexec mousepad /path/to/file

?

---

dogknowsnx wrote:

What's the output of

ls -la ~/.config/{Thunar,Mousepad}

?

$ ls -la ~/.config/{Thunar,Mousepad}
/home/shlw/.config/Mousepad:
total 16
drwx------  2 shlw shlw 4096 22 mai   18:09 .
drwxr-xr-x 33 shlw shlw 4096 25 mai   23:22 ..
-rw-r--r--  1 shlw shlw 7182 25 mai   23:51 accels.scm

/home/shlw/.config/Thunar:
total 24
drwxr-xr-x  2 shlw shlw 4096 25 mai   22:49 .
drwxr-xr-x 33 shlw shlw 4096 25 mai   23:22 ..
-rw-r--r--  1 shlw shlw 7972 25 mai   23:28 accels.scm
-rw-r--r--  1 shlw shlw  189 25 mai   22:49 renamerrc
-rw-r--r--  1 shlw shlw  780 16 juin   2022 uca.xml

As i said in my first post i am unable to change the settings of mousepad in the root instance.
No problem with instance as a regular user.

Offline

#4 2023-05-26 20:59:40

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: Settings not saved in Thunar and Mousepad

EDIT: Nevermind - that bug report had been closed already... (it's too late for me, here)

Maybe somebody that's using the applications in question can help you out... Yet, I don't recommend running a GUI editor with elevated privileges.

Good luck

Last edited by dogknowsnx (2023-05-26 21:14:39)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#5 2023-05-29 11:58:34

lambdarch
Member
Registered: 2021-01-10
Posts: 79

Re: Settings not saved in Thunar and Mousepad

I wonder if there's a way to make full use of Mousepad or Thunar via pkexec from now on, i.e. also being allowed to run the D-Bus services they depend on, especially for saving settings (see also https://bugzilla.xfce.org/show_bug.cgi?id=13884#c12 ).
This works for me, without warnings of any kind and without mixing configurations between root and the regular user, but I still don't know if it's recommended:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY dbus-launch mousepad
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY dbus-launch thunar

By the way, it doesn't use Mousepad or Thunar's polkit file, since dbus-launch is run via pkexec instead.
Otherwise I think the recommended way to do it is

SUDO_EDITOR=mousepad sudoedit /path/to/file
thunar admin:///full/path/to/location

(see e.g. https://bbs.archlinux.org/viewtopic.php … 9#p1926119 ) but it's less convenient, especially for Mousepad.

Offline

#6 2023-05-29 13:53:02

seth
Member
Registered: 2012-09-03
Posts: 53,108

Re: Settings not saved in Thunar and Mousepad

lambdarch wrote:

The recommended way to do it is

SUDO_EDITOR=mousepad sudoedit /path/to/file
thunar admin:///full/path/to/location

Don't run GUI clients as root, that's always wrong and especially w/ filemanagers.

but it's less convenient, especially for Mousepad

Why?

Offline

#7 2023-05-29 14:41:16

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: Settings not saved in Thunar and Mousepad

seth wrote:
lambdarch wrote:

The recommended way to do it is

SUDO_EDITOR=mousepad sudoedit /path/to/file
thunar admin:///full/path/to/location

Don't run GUI clients as root, that's always wrong and especially w/ filemanagers.

Neither of those commands run GUI clients as root.

Offline

#8 2023-05-29 14:49:27

seth
Member
Registered: 2012-09-03
Posts: 53,108

Re: Settings not saved in Thunar and Mousepad

Yes, that's why it's the recommended way over all the other attempts discussed here.
Sorry, maybe I wasn't clear enough about that.

Offline

#9 2023-05-29 15:25:38

lambdarch
Member
Registered: 2021-01-10
Posts: 79

Re: Settings not saved in Thunar and Mousepad

seth wrote:

Don't run GUI clients as root, that's always wrong and especially w/ filemanagers.

I don't do it, but some users do, so as an Xfce dev I try to see if it still works.

seth wrote:

but it's less convenient, especially for Mousepad

Why?

Because you can only edit files passed on the command line, and only if they're not in a writable directory. You can't use the editor's open dialog to open another system file, for example. The edited file is actually a temporary file, so if you close the tab it's not easy to find it again. You can't drag and drop a system file from a file manager... So in short, because you're not running the editor as root smile

Offline

#10 2023-05-29 19:52:57

seth
Member
Registered: 2012-09-03
Posts: 53,108

Re: Settings not saved in Thunar and Mousepad

Because you can only edit files passed on the command line, and only if they're not in a writable directory.

Ha?
Why would you want to sudoedit in a writable path? You're aware that you can delete that file and replace it with whatever you want?
As for the commandline thing, you "export VISUAL=/usr/bin/mousepad" to your session and then have some "sudopad" rightclick menu entry that does "zenity --password | sudoedit -S $1"

For the other stuff you'd indeed need a texteditor that can leverage IO via eg. polkit (or sudo, for that matter) or supports gvfs admin://

Offline

#11 2023-05-29 20:39:23

lambdarch
Member
Registered: 2021-01-10
Posts: 79

Re: Settings not saved in Thunar and Mousepad

> Why would you want to sudoedit in a writable path? You're aware that you can delete that file and replace it with whatever you want?

Yes, I am (sigh), and I don't want anything, I'm just saying that it's an example of a limitation which means that, in the end, the average user won't find this command as convenient as being able to run his favorite editor as root and be able to do everything with it, that's all.

Offline

Board footer

Powered by FluxBB