You are not logged in.
Pages: 1
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
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)
Offline
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
?
---
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
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)
Offline
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.
aka Tamaranch: https://gitlab.xfce.org/Tamaranch
Offline
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?
Online
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
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.
Online
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.
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
aka Tamaranch: https://gitlab.xfce.org/Tamaranch
Offline
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://
Online
> 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.
aka Tamaranch: https://gitlab.xfce.org/Tamaranch
Offline
Pages: 1