about summary refs log tree commit diff
path: root/emacs.d/wpc
diff options
context:
space:
mode:
Diffstat (limited to 'emacs.d/wpc')
-rw-r--r--emacs.d/wpc/packages/wpc-ui.el14
1 files changed, 12 insertions, 2 deletions
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