Xresources 颜色设置

rki*_*huk 7 colors x11 x-resources

我在 XMonad 中使用 Gentoo 并在.Xresources文件中设置所有颜色。问题在于,对于某些应用程序设置*.background并且*.foreground不够,因为它们覆盖了某些字段的设置。下面是一个错误的例子:

在此处输入图片说明

背景应该类似于深色窗口元素,但它是白色和灰色的。

设置对话框窗口颜色的其他一些 xresources 变量是什么?解决这个问题的正确方法是什么?

我当前的.Xresources文件:

! Solarized colorscheme for Xresources
! ====================================




! To choose between light/dark bakground:
! - Define the choice in ``.Xresources`` by hardcoding
!   #define SOLARIZED_LIGHT
!   or
!   #define SOLARIZED_DARK
! - Define the symbol when loading ``.Xresources`` with ``xrdb``:
!   $ xrdb -DSOLARIZED_LIGHT -merge ~/.Xresources




#if !defined(SOLARIZED_LIGHT) && !defined(SOLARIZED_DARK)
#define SOLARIZED_DARK
#elif defined(SOLARIZED_LIGHT) && defined(SOLARIZED_DARK)
#undef SOLARIZED_LIGHT
#endif




! Define Solarized colors
! -----------------------
#define S_base03    #002b36
#define S_base02    #073642
#define S_base01    #586e75
#define S_base00    #657b83
#define S_base0     #839496
#define S_base1     #93a1a1
#define S_base2     #eee8d5
#define S_base3     #fdf6e3




#define S_yellow    #b58900
#define S_orange    #cb4b16
#define S_red       #dc322f
#define S_magenta   #d33682
#define S_violet    #6c71c4
#define S_blue      #268bd2
#define S_cyan      #2aa198
#define S_green     #859900




#ifdef SOLARIZED_LIGHT
#define S_emph      S_base01
#define S_primary   S_base00
#define S_secondary S_base1
#define S_bgrnd_hi  S_base2
#define S_bgrnd     S_base3
#endif
#ifdef SOLARIZED_DARK
#define S_emph      S_base1
#define S_primary   S_base0
#define S_secondary S_base01
#define S_bgrnd_hi  S_base02
#define S_bgrnd     S_base03
#endif




! black dark/light
*color0:                S_base02
*color8:                S_base03
! red dark/light
*color1:                S_red
*color9:                S_orange
! green dark/light
*color2:                S_green
*color10:               S_base01
! yellow dark/light
*color3:                S_yellow
*color11:               S_base00
! blue dark/light
*color4:                S_blue
*color12:               S_base0
! magenta dark/light
*color5:                S_magenta
*color13:               S_violet
! cyan dark/light
*color6:                S_cyan
*color14:               S_base1
! white dark/light
*color7:                S_base2
*color15:               S_base3








! General Xresource settings
! ==========================
!
#define FONT_REGULAR xft:Liberation Mono:style=Regular:pixelsize=14 
#define FONT_BOLD xft:Liberation Mono:style=Bold:pixelsize=14 
#define FONT_ITALIC xft:Liberation Mono:style=Italic:pixelsize=14 
Xft*antialias: true




*foreground:                S_primary
*background:                S_bgrnd
*Foreground:                S_primary
*Background:                S_bgrnd
*cursorColor:               S_emph
*pointerColorForeground:    S_emph
*pointerColorBackground:    S_secondary
*fading:                    40
*fadeColor:                 S_bgrnd








! Xscreensaver
! ============
xscreensaver.captureStderr: false
!font settings
xscreensaver.Dialog.headingFont: FONT_REGULAR
xscreensaver.Dialog.bodyFont:    FONT_REGULAR 
xscreensaver.Dialog.labelFont:   FONT_REGULAR 
xscreensaver.Dialog.unameFont:   FONT_REGULAR 
xscreensaver.Dialog.buttonFont:  FONT_REGULAR 
xscreensaver.Dialog.dateFont:    FONT_REGULAR 
xscreensaver.passwd.passwdFont:  FONT_REGULAR 
!general dialog box (affects main hostname, username, password text)
xscreensaver.Dialog.foreground: S_primary
xscreensaver.Dialog.background: S_bgrnd
xscreensaver.Dialog.topShadowColor: S_bgrnd
xscreensaver.Dialog.bottomShadowColor: S_bgrnd
xscreensaver.Dialog.Button.foreground: S_primary
xscreensaver.Dialog.Button.background: S_bgrnd_hi
!username/password input box and date text colour
xscreensaver.Dialog.text.foreground: S_primary
xscreensaver.Dialog.text.background: S_bgrnd_hi
xscreensaver.Dialog.internalBorderWidth: 24
xscreensaver.Dialog.borderWidth: 0
xscreensaver.Dialog.shadowThickness: 1
xscreensaver*logo.width: 1
xscreensaver*logo.height: 1
!timeout bar (background is actually determined by Dialog.text.background)
xscreensaver.passwd.thermometer.foreground: S_red
xscreensaver.passwd.thermometer.background: S_blue
xscreensaver.passwd.thermometer.width: 4




 
! rxvt-unicode terminal
! =====================
!
URxvt*background: S_bgrnd
URxvt*foreground: S_primary
URxvt*font: FONT_REGULAR
URxvt*boldFont: FONT_BOLD
URxvt*italicFont: FONT_ITALIC
URxvt.colorIT: S_magenta
URxvt.colorBD: S_green
URxvt.colorUL: S_blue
URXVT.borderColor: S_bgrnd_hi
URxvt.highlightColor: S_bgrnd_hi
URxvt.scrollBar: false
URxvt.saveLines: 1000
URxvt.cursorBlink: true
URxvt.pointerBlank: true
URxvt.modifier: alt
Run Code Online (Sandbox Code Playgroud)

小智 7

只是更具体:)

代替:

*background: ...
Run Code Online (Sandbox Code Playgroud)

用:

*vt100.background: ...
Run Code Online (Sandbox Code Playgroud)

这将确保您只影响 vt100 终端而不是其他应用程序。我在 Mathematica 上遇到了这个问题,我的解决方案也适用于您。顺便说一下,我喜欢你实现明暗切换的方式。