doomemacs/core/defuns-ui.el

42 lines
1,006 B
EmacsLisp
Raw Normal View History

2014-12-05 17:28:03 -05:00
(eval-when-compile (require 'cl))
(defvar my/dark-theme-p t)
(defvar my/cycle-font-i 0)
2014-12-05 17:28:03 -05:00
;;;###autoload
(defun load-dark-theme()
(interactive)
(load-theme *dark-theme t))
;;;###autoload
(defun load-light-theme()
(interactive)
(load-theme *light-theme t))
;;;###autoload
(defun toggle-transparency ()
(interactive)
2015-03-18 03:17:43 -04:00
(let* ((alpha (frame-parameter nil 'alpha))
(alpha-val (if (listp alpha) (car alpha) alpha)))
(if (/= alpha-val 97)
(set-frame-parameter nil 'alpha 97)
(set-frame-parameter nil 'alpha 0))))
2014-12-05 17:28:03 -05:00
;;;###autoload
(defun toggle-theme ()
(interactive)
(if my/dark-theme-p
(load-light-theme)
(load-dark-theme)))
;;;###autoload
2015-01-21 00:42:09 -05:00
(defun cycle-font (&optional i)
2015-01-20 14:01:41 -05:00
"Cycle between fonts specified in *fonts in init.el"
2014-12-05 17:28:03 -05:00
(interactive)
2015-01-21 00:42:09 -05:00
(if (numberp i)
(setq my/cycle-font-i i)
(if (>= my/cycle-font-i (1- (length *fonts)))
(setq my/cycle-font-i 0)
(cl-incf my/cycle-font-i)))
2015-04-22 20:48:28 -04:00
(set-frame-font (nth my/cycle-font-i *fonts)))