The aforementioned workaround needs to have an appropriate XAUTHORITY environment variable defined.
To sudo without doing this (e.g., from a command line process), try something like the following:
# assumes the $USER and $HOME directories are defined somehow DBUS_SESSION=$(grep -v "^#" $HOME/.dbus/session-bus/`cat /var/lib/dbus/machine-id`-0) sudo -u $USER $DBUS_SESSION gconftool-2 --type string --set /system/proxy/mode manual
The aforementioned workaround needs to have an appropriate XAUTHORITY environment variable defined.
To sudo without doing this (e.g., from a command line process), try something like the following:
# assumes the $USER and $HOME directories are defined somehow dbus/session- bus/`cat /var/lib/ dbus/machine- id`-0)
DBUS_SESSION=$(grep -v "^#" $HOME/.
sudo -u $USER $DBUS_SESSION gconftool-2 --type string --set /system/proxy/mode manual