Support transparency toggling

The kbd, <super>-u, is modelled after iTerm's <super>-u kbd for toggling
transparency.
This commit is contained in:
William Carroll 2018-06-15 14:26:09 -04:00
parent 27b1a74d07
commit ad496994c8

View file

@ -57,8 +57,18 @@
(setq initial-buffer-choice wpc/current-project) (setq initial-buffer-choice wpc/current-project)
;; transparent Emacs ;; transparent Emacs
(set-frame-parameter (selected-frame) 'alpha '(100 . 100)) (set-frame-parameter (selected-frame) 'alpha '(90 . 90))
(add-to-list 'default-frame-alist '(alpha . (100 . 100))) (setq frame-transparent? t)
(defun wpc/toggle-transparency ()
"Toggle the frame transparency."
(interactive)
(set-frame-parameter (selected-frame) 'alpha '(90 . 90))
(let ((alpha (if frame-transparent? 100 90)))
(set-frame-parameter (selected-frame) 'alpha `(,alpha . ,alpha)))
(setq frame-transparent? (not frame-transparent?)))
(general-def "s-u" #'wpc/toggle-transparency)
;; premium Emacs themes ;; premium Emacs themes
(use-package doom-themes (use-package doom-themes