有什么方法可以改变 whiptail 的特定颜色吗?
例如将特定文本标记为红色?
例如:
#!/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
环境变量,例如。例如:
#!/bin/bash
export NEWT_COLORS='
window=,red
border=white,red
textbox=white,red
button=black,white
'
whiptail ...
或者,您可以使用调色板创建一个配置文件,并使用 NEWT_COLORS_FILE
变量引用它。参见 this answer获取更多信息。
该补丁最初由 Ubuntu 社区创建,但后来 accepted在上游。
关于linux - 改变鞭尾鱼的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46619539/