#!/bin/bash # display number, assuming 0 display=0 # get the machine-id read -r machineid < /var/lib/dbus/machine-id # source the right file under .dbus to set the needed variables . "$HOME/.dbus/session-bus/$machineid-$display" # export the variables sourced from that file export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID DBUS_SESSION_BUS_WINDOWID # Run gconftool-2 gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false gconftool-2 -s -t bool /desktop/gnome/remote_access/view_only false