The following code for your .emacs makes it easy to set transparency from within emacs:
(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)))))Now, you can make make emacs more transparent (less opaque) by pressing C-9, while C-8 has the opposite effect. C-0 brings us back to normality.
Admittedly, window transparency is a classical solution-looking-for-a-problem. But let that not stop us from using it -- now we can watch full-screen movies while still using emacs. That, my friends, is progress.
20 comments:
Very cute!
Where did you get that wallpaper?
@Zerd: interfacelift.com
Your desktop theme is cool .
Gnome ? how you configure it
Is there any way to do this without using a compositing desktop? I currently have a transparent gnome-terminal on my non-compositing xmonad setup. It would be cool if I could do the same with emacs
@Jing: nothing special; gnome with 'MurrinaMyDark' (gtk+) and 'New Wave Dark Menus' (metacity) -- get them from gnome-look.org
@Anonymous: I guess you could try 'xcompmgr'.
Sir, I submit to you that watching a full screen movie while working in emacs *is* a problem that GNUemacs23 has solved!
Try this: to speedbar-frame-parameters add the cons cell '(100 . 50)
Then speedbar will be 50% opaque when not active, and fully opaque when you switch to speedbar.
I'm using it right now.
Thanks. Works under Xfce. How to make it work for KDE4? Has anybody tried it yet?
Awesome!!
Any idea on how to use a .jpg as a background instead of my desktop. My desktop is a cluttered mess and it stresses me out to see it in Emacs.
However, I'd like to see a nice ocean view to calm my nerves during defect fixes.
Hints anyone?
@Anonymous: I don't think that's possible currently -- however, why don't you just move all the Desktop clutter in a folder called 'DesktopClutter', and get a nice relaxing background image from e.g. interfacelift.com (when it's back)?
Thank you for sharing such nice feature of emacs.
Gracias, es el complemento perfecto para la ediciĆ³n de video con
gneve-mode
is there any way to have a transparent background color without having the entire window transparent?
Do u know of a way to make transparency work on KDE4?
@Gabriel Saldana: it seems not to work with KDE4 (or with Gnome-Shell, for that matter). File a bug, I'd say.
Very cool. Works perfectly on Windows 7. Thanks!
What do I have to do to make it work under compiz?
Thank you, very cool.
Is there a way to keep the text opaque?
Cheers,
Timo
Post a Comment