Why do I get IBUS-Warning on running the sudo gedit command?

Whenever I try to run a sudo gedit command as instructed in Step 4 of this answer, my terminal puts out:

(gedit:7549): IBUS-WARNING **: The owner of /home/jared/.config/ibus/bus is not root!

How do I get out of this situation?


You should always use gksudo instead of sudo to launch graphical applications otherwise the environmental variables aren't set up correctly.

In your example ibus is looking at the files in your users home directory instead of roots home directory as it should be doing.


No need for gksudo. To make sudo do what you want, add the -H (or --set-home) switch. Thus:

$ sudo -H gedit /etc/bluetooth/main.conf