12

I've been looking for themes which are transparent, but I didn't find any. Is there someone who uses a transparent theme?

0

2 Answers 2

17

I found a solution, and no longer I need transparent theme.

The solution is :

;; set transparency
(set-frame-parameter (selected-frame) 'alpha '(85 85))
(add-to-list 'default-frame-alist '(alpha 85 85))
3
  • 1
    how do you put this into emacs? for someone new to emacs is this in a file somewhere or at a command?
    – Vass
    Sep 11, 2016 at 21:34
  • 8
    Unfortunately, this doesn't just change the background, but also makes text transparent as well.
    – Jake
    Dec 13, 2016 at 17:23
  • Can you comment on what this code does, exactly? Why are there two parameters?
    – henning
    Mar 4, 2022 at 9:12
8

You can set transparency within Emacs by setting 'alpha frame parameter,

This parameter specifies the opacity of the frame, on graphical displays that support variable opacity. It should be an integer between 0 and 100, where 0 means completely transparent and 100 means completely opaque. It can also have a nil value, which tells Emacs not to set the frame opacity (leaving it to the window manager).

To prevent the frame from disappearing completely from view, the variable frame-alpha-lower-limit defines a lower opacity limit. If the value of the frame parameter is less than the value of this variable, Emacs uses the latter. By default, frame-alpha-lower-limit is 20.

The alpha frame parameter can also be a cons cell (‘active’ . ‘inactive’), where ‘active’ is the opacity of the frame when it is selected, and ‘inactive’ is the opacity when it is not selected.

but more general solution is to use your compositor manager.

For example with Compton you can change Emacs’ (or any window) opacity with following change in Compton’s config (i.e. ~/.config/compton.conf file):

opacity-rule = [ "90:class_g = 'Emacs'", # 10% of transparency
                 "90:!focused && class_g = 'Conkeror'"] # as a bonus

Solution will vary between operating systems and windowing systems ergo I’m providing this answer only FWIW.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.