[ale] [OT] Making Emacs transparent in Cywgin

Jonathan Meek jonathan.l.meek at gmail.com
Thu Oct 31 10:21:20 EDT 2013


Hey guys,

Came across a way to make Emacs transparent in Cywgin after a bit of
research and wanted to share.

1) start up Emacs
2) Add the following code to the buffer:

         (defun djcb-opacity-modify (&optional dec)
  "modify the transparency of the emacs frame; if DEC is t,
    decrease the transparency, otherwise increase it in 10%-steps"
  (let* ((alpha-or-nil (frame-parameter nil 'alpha)) ; nil before setting
          (oldalpha (if alpha-or-nil alpha-or-nil 100))
          (newalpha (if dec (- oldalpha 10) (+ oldalpha 10))))
    (when (and (>= newalpha frame-alpha-lower-limit) (<= newalpha 100))
      (modify-frame-parameters nil (list (cons 'alpha newalpha))))))

 ;; C-8 will increase opacity (== decrease transparency)
 ;; C-9 will decrease opacity (== increase transparency
 ;; C-0 will returns the state to normal
(global-set-key (kbd "C-8") '(lambda()(interactive)(djcb-opacity-modify)))
(global-set-key (kbd "C-9") '(lambda()(interactive)(djcb-opacity-modify t)))
(global-set-key (kbd "C-0") '(lambda()(interactive)
                               (modify-frame-parameters nil `((alpha .
100)))))

3) save the file (C-x C-s) at ~/emacs.d/init.el
4) restart Emacs

Note: this sets that C-8 decrease transparency, C-9 to increase
transparency and C-0 to set to normal

Resources to make this guide:
http://emacs-fu.blogspot.com/2009/02/transparent-emacs.html
http://www.cs.colostate.edu/helpdocs/emacs.html
http://www.emacswiki.org/emacs/InitFile

Regards,

Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20131031/915784db/attachment-0001.html>


More information about the Ale mailing list