Opening the apps such as Gedit or Gnome Text Editor with sudo in Terminal, will open the app with default preferences and furthermore it won’t let me change those settings; however as an administrative user I have changed various preferences that seem to be ignored.
Here’s a screenshot for comparison: root vs. user
When trying to change the preferences after opening the app with sudo, I get the following error/warning in Terminal (in which tedit is a symbolic link to gnome-text-editor):
(tedit:37067): dconf-WARNING **: 11:36:56.149: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=cca92021290f49f5b00d396a So, is there a way to change preferences for root to be followed when opening the app with root privileges?
I tried the following with no success:
- Logging in as root with
su rootand then opening the app; - Opning the app using
gksu; - Editing the default parameters of gsettings schema for the specific app in
/usr/share/glib-2.0/schemas/org.gnome.TextEditor.gschema.xml; - Opening the directory
/usr/share/applicationsas administrator and then launch the app using .desktop files.
Edit 1
I just found out the option sudo -E as a workaround to open a file with root but in my user environment, for examle:
sudo -E gnome-text-editor [path-to-file] But I’m still eager to know if there’s a straightforward method to change root preferences permanently.
Edit 2
I found out accidentally that the foremenitoned method (3), i.e. changing schema’s default values, does work but you need to recompile them with:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ Yet I consider this as another workaround, not a real answer.
