有没有办法改变鞭尾的特定颜色?
例如,用红色标记特定文本?
例如 :
#!/bin/bash
window=$(stty -a | tr \; \\012 |egrep 'rows|columns' | cut '-d ' -f3)
RED="red"
GREEN="green"
OPTION=$(whiptail --menu "\n\n\n\n\n\n\n\n" --title "menu" --nocancel $window 20 \
"1" "COLOUR IS $RED" \
"2" "COLOUR IS $GREEN" 3>&1 1>&2 2>&3)
我怎样才能为$RED和$GREEN上色?
解决方法:
从版本0.52.13(2011年发布)开始,您可以使用NEWT_COLORS环境变量,例如: G.:
#!/bin/bash
export NEWT_COLORS='
window=,red
border=white,red
textbox=white,red
button=black,white
'
whiptail ...
或者,您可以使用调色板创建配置文件,并使用NEWT_COLORS_FILE变量引用它.有关更多信息,请参见this answer.
该补丁最初由Ubuntu社区创建,但后来在accepted上游.
标签:bash,linux,colors,whiptail
来源: https://codeday.me/bug/20190828/1750134.html