When I open a file with root gedit I'd like to have the same setup as my normal gedit. So theme, preferences, and addons.
Can I set up some sym links in the right spot to achieve this?
When I open a file with root gedit I'd like to have the same setup as my normal gedit. So theme, preferences, and addons.
Can I set up some sym links in the right spot to achieve this?
I think this is quite impossible because gedit manages its settings through gconf and to sync these it would require a gnome-settings-deamon running for root.
You normally wouldn't synchronize normal gedit settings with root gedit user settings.
Root has its own settings, and the computer user has his own settings. The two are not the same. This is by design.
When you are operating as root, you are using the root user's profile, and when you're operating as yourself, you're using your personal profile. Each has its own permissions and ownership, tied to that particular account. They're not intended to be the same.
Have
sudo
inherit your user accountgedit
settingsIn this example the user settings for font name, font size, tab stops, convert tabs to spaces, 80 column highlight, and right side thumbnail slider bar have been inherited by
sudo
.With regular
sudo -H gedit
you cannot make nor save these configuration settings. With the script belowsgedit
the settings are inherited from your user account.This script also addresses the "
gksu
is bad and not installed by default" and "pkexec
is hard to setup" problems.Background
I've been nagged by the same issue for years. This weekend's project was to write the
sgedit
script:sgedit filename1 filename2...
sudo -H
to preserve file ownership whilst getting root powers.gsettings set
on the differences only (reduces 174set
commands to a dozen or less. Next time it's run perhaps only one or two changes but often times none.Bash script
sgedit
Housekeeping
Copy the bash script above to a new file called
sgedit
. I recommend placing it in your$HOME/bin
directory, ie/home/YOURNAME/bin
. You may have to create the directory first.Mark the file as executable using:
Note
~
is a shortcut for/home/YOURNAME
.