You are not logged in.
If I run gedit as root with
sudo gedit
I'm unable to change settings (like the color profile).
In the terminal I get the error
failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=3f67c676947b4093a67081e66ce01682 --binary-syntax --close-stderr”: Child process exited with code 1
Last edited by sakya (2021-11-28 10:52:23)
Offline
That's because you shouldn't be using sudo to run GUI applications in the first place.
Offline
To edit files as root use the GVFS admin:// backend:
gedit admin:///full/path/to/file
EDIT: or
SUDO_EDITOR=gedit sudoedit /full/path/to/file
Set the SUDO_EDITOR variable globally if you always want to use gedit.
EDIT2: and for bonus points here's a root-editor.desktop file to allow use from a menu or file manager:
[Desktop Entry]
Name=Sudoeditor
Comment=Edit text files as root
Exec=rootedit %U
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Icon=org.gnome.gedit
Categories=GNOME;GTK;Utility;TextEditor;
^ Place that file in /usr/local/share/applications/ (for system-wide use) or ~/.local/share/applications (for just your user).
And this is the rootedit script:
#!/bin/sh
SUDO_EDITOR=gedit sudoedit "$@"
^ Make that executable and place it under /usr/local/bin/ (or in ~/bin/).
Once they are in place select "Sudoeditor" as the application from the file manager
Last edited by Head_on_a_Stick (2021-11-28 10:45:57)
Offline
To edit files as root use the GVFS admin:// backend:
gedit admin:///full/path/to/file
Many thanks, easy solution
Offline