在Emacs的透明背景在Gnome壳

Man*_*lva 8 linux emacs ubuntu transparency gnome-shell

这个问题与前一个问题的连续性有关:如何使emacs控制台模式继承shell颜色

在Ubuntu 12.10和Gnome Shell 3.6.2上,我正在运行Emacs.关于http://www.emacswiki.org/emacs/TransparentEmacs我可以使用以下方法在我的Emacs X窗口上设置alpha透明度:

(set-frame-parameter (selected-frame) 'alpha '(85 50))
(add-to-list 'default-frame-alist '(alpha 85 50))
Run Code Online (Sandbox Code Playgroud)

不幸的是,这为我的emacs窗口中的所有"项目"设置了透明度,包括包含文本的前景.因此,很难阅读Emacs内容.我正在寻找的只是在背景上设置alpha值的方法.通过这种方式,我将能够清楚地看到我的Emacs窗口的内容,并从emacs后面的窗口中读取信息(我用非常好的gnome终端成功地做到了这一点).

小智 -1

我的工作正常 - 前景以我在 .Xresources 中设置的颜色可见。也许你可以尝试一下,比如:

emacs*foreground: gold
emacs*background: black
Run Code Online (Sandbox Code Playgroud)

可以进去~/.Xresources然后使用命令

$ xrdb ~/.Xresources
Run Code Online (Sandbox Code Playgroud)

在使用您给出的这两行调用 emacs 之前(在 ~/.emacs 中):

(set-frame-parameter (selected-frame) 'alpha '(85 50))
(add-to-list 'default-frame-alist '(alpha 85 50))
Run Code Online (Sandbox Code Playgroud)

我更新了上面的内容,将这两行包含在 ~/.emacs 中,因为这些是设置透明度的工作原理。此外,我确实注意到,当我的 emacs 窗口失去焦点时,前景也会变得透明。也许这就是你的意思?

  • 感谢您的回答,但这并不能解决我的问题,而只是更改指定的前景和背景。我想要的只是透明背景。 (2认同)