4

I have installed awesome on top of Ubuntu 10.04 and switch between Gnome and Awesome sessions (partly because I am still learning awesome and partly because I use a few apps that require Gnome desktop). Further I need to use a proxy server @ work whereas @ home I have a direct connection.

Under GNOME, I have defined 2 locations with gnome-network-properties (hereafter, g-n-p) and switch between these as needed.

However, when I login to awesome, I am left with the settings as set in my last GNOME session. I can't invoke g-n-p because it needs gnome-settings-daemon to be running which is of course not the case. If I need to change I need to logout and in twice (once into GNOME to switch location and then back into awesome). Since I use many apps within awesome that use system proxy settings (Synaptic, Firefox) I'd like to be able to centrally switch the proxy configuration without leaving the awesome desktop.

I understand running gnome-network-properties sets some gconf-editor keys and also updates *_proxy environment vars in /etc/environment (and probably elsewhere also). Is there a way to achieve the same effect via a script or some replacement tool for g-n-p that doesn't use gnome-settings-daemon ?

3 Answers 3

5

You can start gnome-settings-daemon as part of your Awesome start up process. I usually invoke it manually when needed.

Add this to your ~/.config/awesome/rc.lua file: awful.util.spawn_with_shell("gnome-settings-daemon")

… if you want to run it on startup. For me, at least, this was a lot easier than any other method I've tried.

2
  • I will definitely give this a try. However, the reason I use awesome is because (on my rather old laptop) the GNOME desktop uses up far too much resources. With my limited understanding, gnome-setting-daemon is one of the suspects. So, if I don't want to run it on startup, I could still run it like a normal command and then use g-n-p right ? After g-n-p finishes successfully, how do I stop gnome-settings-daemon ?
    – koushik
    Aug 28, 2010 at 9:46
  • Yes, you can, that's how I do it, see above. You can stop it using killall.
    – lfaraone
    Aug 31, 2010 at 0:18
1

I made a script to be asked for passwords, now I can use gnome-network-properties apply system-wide without running gnome-settings-daemon.

/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
gnome-network-properties
killall polkit-gnome-authentication-agent-1
0

Since you're using Awesome (as I do :) ) you might be interested in a solution that is not dependend on running the gnome-blob-softwares...

Here is the script that I run when Awesome starts (in fact I have a "master" script that is ran from ~/.config/awesome/rc.lua and that launches this script)

export no_proxy=localhost,127.0.0.1,*.example.com
export http_proxy=http://ex.example.net:8080/
export https_proxy=https://ex.example.net:8080/
export ftp_proxy=ftp://ex.example.net:8080/
# export socks_proxy=""   # I do not use this

# Configuration
gsettings set org.gnome.system.proxy.http host 'ex.example.net'
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.http use-authentication false
gsettings set org.gnome.system.proxy use-same-proxy false
gsettings set org.gnome.system.proxy.https host 'ex.example.net'
gsettings set org.gnome.system.proxy.https port 8080
gsettings set org.gnome.system.proxy.ftp host 'ex.example.net'
gsettings set org.gnome.system.proxy.ftp port 8080
gsettings set org.gnome.system.proxy.socks host ''  # I do not use this
gsettings set org.gnome.system.proxy.socks port 0

# Enabling
gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http enabled true
gsettings set org.gnome.system.proxy ignore-hosts "[ 'localhost', '127.0.0.0/8' ]"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .