2008年3月5日 星期三

自訂 Console 的文字顏色

有鑑於 Fedora 的 kconsole 每次預設的 資料夾 文字顯示顏色都是深藍字,而我又喜歡用黑底的 console,最後的結果就是每次都看不清楚資料夾名稱。

因此在這裡記錄一下要怎麼修改 console 底下文字顏色的方法。



Step 1.
編輯 /etc/DIR_COLORS.xterm

找到這一段:

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 00;34 # directory
LINK 00;36 # symbolic link
FIFO 40;33 # pipe
SOCK 00;35 # socket
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 01;05;37;41 # orphaned syminks
MISSING 01;05;37;41 # ... and the files they point to



Step 2.
把這一行:
DIR 00;34 # directory

改成這樣:
DIR 00;34;46 # directory


之後存檔~




Setp 3.
重新開啟一個 console,這時候就會看到,所有的資料夾變成 淺藍底色 + 深藍字 了~
也可以改成其他的顏色,或修改其他項目喔!




ps.如果修改 /etc/DIR_COLORS.xterm 沒有用,那就修改這個檔案 /etc/DIR_COLORS 。
傳說中 /etc/DIR_COLORS.xterm 是給 X Window 用的,/etc/DIR_COLORS 是文字模式用的。


0 意見: