Skip to content

Instantly share code, notes, and snippets.

@itoshkov itoshkov/init.el
Created Dec 19, 2018

What would you like to do?
Change the emacs theme to light or dark variant (GTK+-3)
(defun set-emacs-frames (variant)
(dolist (frame (frame-list))
(let* ((window-id (frame-parameter frame 'outer-window-id))
(id (string-to-number window-id))
(cmd (format "xprop -id 0x%x -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT \"%s\""
id variant)))
(call-process-shell-command cmd))))
(defun set-emacs-theme-light ()
(load-theme 'solarized-light t)
(set-emacs-frames "light"))
(defun set-emacs-theme-dark ()
(load-theme 'solarized-dark t)
(set-emacs-frames "dark"))
(if (window-system)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.