Skip to content

Instantly share code, notes, and snippets.

@halbtuerke
Created August 27, 2014 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halbtuerke/6b0266b367ab41efa649 to your computer and use it in GitHub Desktop.
Save halbtuerke/6b0266b367ab41efa649 to your computer and use it in GitHub Desktop.
(defun toggle-transparency ()
"Toggles the transparency of the current frame"
(interactive)
(let ((alpha-value 85))
(cond
((equal (frame-parameter nil 'alpha) nil) ; case 1
(set-frame-parameter (selected-frame) 'alpha '(alpha-value alpha-value))) ; action 1
((= alpha-value (car (frame-parameter nil 'alpha))) ; case 2
(set-frame-parameter (selected-frame) 'alpha '(100 100))) ; action 2
(t ; default case
(set-frame-parameter (selected-frame) 'alpha '(alpha-value alpha-value))))) ; default action
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment