From 8faa6d88687e222343a10ff8902ed87a57890bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Sun, 9 Apr 2017 21:39:43 +0200 Subject: [PATCH] switch to spacemacs-dark-theme, new functions my-(light|dark)-theme --- init.el | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 9a72b8e..78bf768 100644 --- a/init.el +++ b/init.el @@ -124,10 +124,26 @@ Argument FRAMES has the same meaning as for `set-frame-font'" :defer) (defun my-make-frame-function(frame) - (when (not (custom-theme-p 'tango-dark)) - (load-theme 'tango-dark) - (if (require 'powerline nil t) - (powerline-center-theme)))) + (with-selected-frame frame ;; needed for spacemacs powerline colors to be applied properly + (when (not (featurep 'spacemacs-dark-theme)) + (require 'spacemacs-dark-theme nil t) + (when (require 'powerline nil t) + (powerline-center-theme))))) + +(defun my-light-theme () + "Switch to Spacemacs light theme." + (interactive) + (when (require 'spacemacs-light-theme nil t) + (enable-theme 'spacemacs-light) + (disable-theme 'spacemacs-dark))) + +(defun my-dark-theme () + "Switch to Spacemacs dark theme." + (interactive) + (when (require 'spacemacs-dark-theme nil t) + (enable-theme 'spacemacs-dark) + (disable-theme 'spacemacs-light))) + (when window-system (my-make-frame-function (selected-frame)))