2012-04-28 773 views

回答

1

因爲它似乎是你談論的終端,你是否禁用了「在顏色下使用系統主題中的顏色」?一旦你這樣做,你可以選擇一個背景顏色,仍然在顏色標籤下。背景標籤看起來像它只允許選擇一個圖像(或透明度),也使我絆倒。

29

有兩種很好的方法來改變xterm的背景顏色(記住xterm!= Terminal)。

答:當您創建的xterm設置顏色: 例如,

% xterm -bg yellow & 

OR

B.編輯.Xdefaults中包括色彩規範,如以下幾點: 的XTerm *背景:黃

% vi ~/.Xdefaults (pick your favorite editor) 

這也可以通過鍵入以下內容的xterm完成:

% cat >> ~/.Xdefaults <RETURN> 
XTerm*background:yellow<RETURN> 
<CTRL-D> 

無論怎樣你改變.Xdefaults中,更改將不會生效,直到:

  • xrdb ~/.Xdefaults
  • X服務器重新啓動,可能是做到這一點的最簡單的方法就是重新啓動計算機,或註銷。

然後,它將被設置一勞永逸。

+7

無需重新啓動X'xrdb〜/ .Xdefaults' – holms 2013-10-14 09:25:59

+0

非常真實!對於更多專家用戶來說,這是一條路。 – Paul 2013-10-15 16:27:57

+3

更新:截至2016年1月,'〜/ .Xdefaults'已被棄用,以支持'〜/ .Xresources'。 因此,需要在'〜/ .Xresources'文件中添加'XTerm * Background:LemonChiffon'行,其中'LemonChiffon'是一個顏色名稱。 有關您的XTerm版本可能支持的顏色列表,請參閱https://critical.ch/xterm/。 – 2016-02-01 22:24:15

3

我用下面的顏色和字體設置爲的xterm倒車默認前景色和背景色。 將以下內容添加到主目錄中的「.Xresources」文件中。

XTerm*faceName: Bitstream Vera Serif Mono 
xterm*faceSize: 11 
xterm*vt100*geometry: 80x60 
xterm*saveLines: 16384 
xterm*loginShell: true 
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48 
xterm*termName: xterm-color 
xterm*eightBitInput: false 

!BLK Cursor 
#define _color0  #000d18 
#define _color8  #000d18 
!RED Tag 
#define _color1  #e89393 
#define _color9  #e89393 
!GRN SpecialKey 
#define _color2  #9ece13 
#define _color10  #9ece13 
!YEL Keyword 
#define _color3  #f0dfaf 
#define _color11  #f0dfaf 
!BLU Number 
#define _color4  #8cd0d3 
#define _color12  #8cd0d3 
!MAG Precondit 
#define _color5  #c0bed1 
#define _color13  #c0bed1 
!CYN Float 
#define _color6  #dfaf8f 
#define _color14  #dfaf8f 
!WHT Search 
#define _color7  #efefef 
#define _color15  #efefef 
!FMT Include, StatusLine, ErrorMsg 
#define _colorBD  #ffcfaf 
#define _colorUL  #ccdc90 
#define _colorIT  #80d4aa 
!TXT Normal, Normal, Cursor 
#define _foreground #dcdccc 
#define _background #1f1f1f 
#define _cursorColor #8faf9f 
URxvt*color0   : _color0 
URxvt*color1   : _color1 
URxvt*color2   : _color2 
URxvt*color3   : _color3 
URxvt*color4   : _color4 
URxvt*color5   : _color5 
URxvt*color6   : _color6 
URxvt*color7   : _color7 
URxvt*color8   : _color8 
URxvt*color9   : _color9 
URxvt*color10  : _color10 
URxvt*color11  : _color11 
URxvt*color12  : _color12 
URxvt*color13  : _color13 
URxvt*color14  : _color14 
URxvt*color15  : _color15 
URxvt*colorBD  : _colorBD 
URxvt*colorIT  : _colorIT 
URxvt*colorUL  : _colorUL 
URxvt*foreground  : _foreground 
URxvt*background  : _background 
URxvt*cursorColor : _cursorColor 
XTerm*color0   : _color0 
XTerm*color1   : _color1 
XTerm*color2   : _color2 
XTerm*color3   : _color3 
XTerm*color4   : _color4 
XTerm*color5   : _color5 
XTerm*color6   : _color6 
XTerm*color7   : _color7 
XTerm*color8   : _color8 
XTerm*color9   : _color9 
XTerm*color10  : _color10 
XTerm*color11  : _color11 
XTerm*color12  : _color12 
XTerm*color13  : _color13 
XTerm*color14  : _color14 
XTerm*color15  : _color15 
XTerm*colorBD  : _colorBD 
XTerm*colorIT  : _colorIT 
XTerm*colorUL  : _colorUL 
XTerm*foreground  : _foreground 
XTerm*background  : _background 
XTerm*cursorColor : _cursorColor 

當你保存的文件,運行以下命令以保存更改:

xrdb -merge ~/.Xresources 
+0

雖然這個鏈接可能回答這個問題,但最好在這裏包含答案的基本部分,並提供供參考的鏈接。如果鏈接頁面更改,則僅鏈接答案可能會失效。 - [來自評論](/評論/低質量帖/ 12622061) – 2016-06-08 15:10:01

+0

將更新細節,你是正確的託尼! – Arahkun 2016-06-08 15:25:24