summaryrefslogtreecommitdiffstats
path: root/shell/_emacs.d/site-lisp/dconf-proxy.el
blob: 954852a4c928ff0bc7a9461031233e1793cb9d50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(defun refresh-proxy-settings ()
  (interactive)
  (if (string= (shell-command-to-string "dconf read /system/proxy/http/enabled") "true\n")
      (setq url-proxy-services
	    `(("http" .
	       ,(concat
		 (car (split-string-and-unquote ;; split string to remove single quotes and newline
		       (shell-command-to-string "dconf read /system/proxy/http/host") '"'"))
		 ":"
		 (car (split-string-and-unquote ;; split string to remove newline
		       (shell-command-to-string "dconf read /system/proxy/http/port") '"\n"))))))
    (setq url-proxy-services nil)))

(provide 'dconf-proxy)