3

How do I manually from terminal set the value of proxy server read by gnome-control-center? It doesn't use the http_proxy environmental variable and I notice apps such as Browsers uses value in the gnome-control-center when I choose use system default proxy

gnome-control-center Network Proxy config

programs started from cli end up using http_proxy variable but others started from Launcher uses value by gnome-control-center, and I end up having to set values in 2 different places

1
  • 1
    yes thank you very much. It was after I posted that I realize that automatic is actually 'auto' not none
    – Mab
    Commented May 27 at 11:40

1 Answer 1

4

Use gsettings; to set everything exactly as shown in the screenshot:

gsettings set org.gnome.system.proxy mode 'manual'
gsettings set org.gnome.system.proxy.http host '192.168.220.181'
gsettings set org.gnome.system.proxy.http port 8080
gsettings set org.gnome.system.proxy.https host '192.168.220.181'
gsettings set org.gnome.system.proxy.https port 8080
gsettings set org.gnome.system.proxy.ftp host ''
gsettings set org.gnome.system.proxy.ftp port 0
gsettings set org.gnome.system.proxy.socks host ''
gsettings set org.gnome.system.proxy.socks port 0
gsettings set org.gnome.system.proxy ignore-hosts '["localhost", "127.0.0.0/8", "::1"]'

In general, to get an idea of which values can be assigned to a property and what they do, you can run gsettings range and gsettings describe on the target property; for example:

% gsettings range org.gnome.system.proxy mode
enum
'none'
'manual'
'auto'
% gsettings describe org.gnome.system.proxy mode
Select the proxy configuration mode. Supported values are “none”, “manual”, “auto”.

If this is “none”, then proxies are not used.

If it is “auto”, the autoconfiguration URL described by the “autoconfig-url” key is used.

If it is “manual”, then the proxies described by “/system/proxy/http”, “/system/proxy/https”, “/system/proxy/ftp” and “/system/proxy/socks” will be used. Each of the 4 proxy types is enabled if its “host” key is non-empty and its “port” key is non-0.

If an http proxy is configured, but an https proxy is not, then the http proxy is also used for https.

If a SOCKS proxy is configured, it is used for all protocols, except that the http, https, and ftp proxy settings override it for those protocols only.
0

You must log in to answer this question.

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