blog + microblog + linkblog + site updates + contact + about me + RSS

writer13's webspace

Emacs transparency

If you want to beautify your desktop and love some nice transparency effect, this is how you can do it, in Emacs.

This sets it for active and inactive frames, of course you can experiment with the values:

;;(set-frame-parameter (selected-frame) 'alpha '(<active> . <inactive>))
;;(set-frame-parameter (selected-frame) 'alpha <both>)
(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
(add-to-list 'default-frame-alist '(alpha . (85 . 50)))

And here is a shortcut (C-c t) to turn it on/off:

 (defun toggle-transparency ()
         (interactive)
         (let ((alpha (frame-parameter nil 'alpha)))
                 (set-frame-parameter
                 nil 'alpha
                 (if (eql (cond ((numberp alpha) alpha)
             ((numberp (cdr alpha)) (cdr alpha))
             ;; Also handle undocumented (<active> <inactive>) form.
             ((numberp (cadr alpha)) (cadr alpha)))
       100)
  '(85 . 50) '(100 . 100)))))
(global-set-key (kbd "C-c t") 'toggle-transparency)

Credit: Emacs wiki

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

In case you are wondering: This website doesn't track you. I don't use any javascript or other scripts. I don't store any information about the visitors. It's just pure old fashioned HTML and some CSS (plus some custom fonts). Hosted on Neocities and created with Emacs.

parasurv.neocities.org 2018-2022 - writer13.neocities.org 2022-