Monday, October 12, 2009

Transparent emacs on windows



Here's a handy function which lets you choose a transparent level (0 is fully transparent and 100 is opaque), for the main emacs frame in both focused and unfocused state.
(defun transparent(alpha-level no-focus-alpha-level)
"Let's you make the window transparent"
(interactive "nAlpha level (0-100): \nnNo focus alpha level (0-100): ")
(set-frame-parameter (selected-frame) 'alpha (list alpha-level no-focus-alpha-level))
(add-to-list 'default-frame-alist `(alpha ,alpha-level)))

To run M-x transparent. 

Enter the values you want for when the window has focus and when it does not. In the background you can see system status information on the desktop, which is another excellent utility from sysinternals called BgInfo. It let's you display useful info about your system right on your desktop, similar to tools you may find on linux. 


6 comments:

coldhead said...

This code throws an error when you go to create a new frame (like C-x 5 2)

Justin said...

You're right! I'll try and figure that out.

Justin said...

Ok that's fixed now, sorry.

Uriel Avalos said...

Wow this is awesome

Nic said...

thanks!

Paradigm said...

thanks, i'm totally enjoying my transparent bg