I've been looking for themes which are transparent, but I didn't find any. Is there someone who uses a transparent theme?
2 Answers
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))

- 787
- 1
- 6
- 17
-
1how do you put this into emacs? for someone new to emacs is this in a file somewhere or at a command? – Vass Sep 11 '16 at 21:34
-
8Unfortunately, this doesn't just change the background, but also makes text transparent as well. – Jake Dec 13 '16 at 17:23
-
Can you comment on what this code does, exactly? Why are there two parameters? – henning Mar 04 '22 at 09:12
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.