2007-02-26

Set the proxy for GNOME

I like surfing with Epiphany over the bloated Firefox but it doesn't provide a setting dialog for the proxy. It is configured system wide with gconf. A nice editor to have a quick look at the settings is gconf-editor and once you know what to set you can use the command line tool gconftool-2.

Here is a script to switch the proxy on/off with an optional host and port.

#! /bin/sh
# Switches the GNOME proxy on/off and
# can take an optional proxy host+port

usage ()
{
cat << CAT
Usage: `basename $0` on|off [host [port]]
CAT
exit 1
}

[ $# -lt 1 ] && usage

case "$1" in
"on")
mode="manual"
;;
"off")
mode="none"
;;
*)
usage
;;
esac

gconftool-2 -t string -s /system/proxy/mode "$mode"
[ ! -z "$2" ] && \
gconftool-2 -t string -s /system/http_proxy/host "$2"
[ ! -z "$3" ] && \
gconftool-2 -t int -s /system/http_proxy/port "$3"

As usual you can follow the changes at mykey57.free.fr/pub/misc/bin/.
Enjoy!

No comments:

Post a Comment