From 56d09168a000f3f48239ee30725e1f8d213c617f Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Sat, 28 Oct 2023 18:43:12 +0200 Subject: revert+fix: changed back to "toggle-transparency" and fixed it --- config.org | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/config.org b/config.org index 76838bd..cee9d7b 100644 --- a/config.org +++ b/config.org @@ -345,21 +345,23 @@ My preferred org-mode defaults * Custom functions -** Set Frame Alpha +** Toggle Transparency -Function to interactively set transparancy. +Function to toggle transparency #+begin_src emacs-lisp - (defun set-frame-alpha (arg &optional active) - (interactive "nEnter alpha value (1-100): \np") - (let* ((elt (assoc 'alpha default-frame-alist)) - (old (frame-parameter nil 'alpha)) - (new (cond ((atom old) `(,arg ,arg)) - ((eql 1 active) `(,arg ,(cadr old))) - (t `(,(car old) ,arg))))) - (if elt (setcdr elt new) (push `(alpha ,@new) default-frame-alist)) - (set-frame-parameter nil 'alpha new))) - (global-set-key (kbd "C-c t") 'set-frame-alpha) + (defconst frame-transparency 85) + + (defun toggle-transparency () + (interactive) + (let ((frame-alpha (frame-parameter nil 'alpha))) + (if (or (not frame-alpha) + (= (cadr frame-alpha) 100)) + (set-frame-parameter nil 'alpha + `(,frame-transparency + ,frame-transparency)) + (set-frame-parameter nil 'alpha '(100 100))))) + (global-set-key (kbd "C-c t") 'toggle-transparency) #+end_src ** Config edit/reload @@ -644,17 +646,6 @@ Better looking modeline. Using powerline with the spaceline theme ('after-init-hook) . 'powerline-reset) #+end_src -** Initialize =popup-kill-ring= - -Replaces the default "M-y" kill ring with a popup menu for easy selection - -#+begin_src emacs-lisp - (use-package popup-kill-ring - :ensure t - :bind - ("M-y" . popup-kill-ring)) -#+end_src - ** Initialize =page-break-lines= Display ^L page breaks as a horizontal line -- cgit v1.2.3