Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
标题设置了问题。如果可以,编码是什么?现在的编码是:- yad --center --on-top --text-align=center --buttons-layout=center --title ${0##*/} --width=150 --height=60 - -文本“你想喝茶吗?” --button=gtk-no:1 --button=gtk-yes:0 我想让yes按钮成为默认按钮,所以即使我只是关闭框,yes按钮也会被选中。非常感谢约翰
此代码段在系统托盘中启动一个默认图标:
yad --notification xxx
发现那个$?对于 Yes=0、No=1 和 Close=252,因此允许外部编码以使 Yes 按钮成为默认值。:-
if [[ $? == 0 || $? == 252 ]] then echo "Default" else echo "No" fi