From ad496994c82b445c5f47956179f86ec5a7e26838 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 15 Jun 2018 14:26:09 -0400 Subject: Support transparency toggling The kbd, -u, is modelled after iTerm's -u kbd for toggling transparency. --- emacs.d/wpc/packages/wpc-ui.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'emacs.d/wpc/packages') diff --git a/emacs.d/wpc/packages/wpc-ui.el b/emacs.d/wpc/packages/wpc-ui.el index c8126356e4f7..e4f0cd9f7ea5 100644 --- a/emacs.d/wpc/packages/wpc-ui.el +++ b/emacs.d/wpc/packages/wpc-ui.el @@ -57,8 +57,18 @@ (setq initial-buffer-choice wpc/current-project) ;; transparent Emacs -(set-frame-parameter (selected-frame) 'alpha '(100 . 100)) -(add-to-list 'default-frame-alist '(alpha . (100 . 100))) +(set-frame-parameter (selected-frame) 'alpha '(90 . 90)) +(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 (use-package doom-themes -- cgit 1.4.1