Bash,没有取消的zenity进度条
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4907381/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bash, zenity progress bar without cancel
提问by Butch
Currently developing a small bash script, my needs are a progress bar that doesn't come with a cancel button. I have been looking into the zenity progress bar, but haven't found a way to get rid of the cancel button.
目前正在开发一个小的 bash 脚本,我需要一个没有取消按钮的进度条。我一直在研究 zenity 进度条,但还没有找到摆脱取消按钮的方法。
The non-existence of the cancel button is of the essence, since it would completely ruin the means of the progress bar. I saw a terminal-based progress bar around, but since I use zenity dialogs for all other cases, I want to use it for the progress bar as well.
取消按钮的不存在至关重要,因为它会完全破坏进度条的手段。我看到了一个基于终端的进度条,但由于我在所有其他情况下都使用 zenity 对话框,因此我也想将它用于进度条。
Any idéas how to solve my issue? Any other progress bars around, or is it possible to get rid of the cancel button?
任何想法如何解决我的问题?周围还有其他进度条,还是可以去掉取消按钮?
Any help is very appreciated, thanx!
非常感谢任何帮助,thanx!
采纳答案by sepp2k
zenitysupports the --no-cancelflag, which removes the cancel button.
zenity支持--no-cancel移除取消按钮的标志。
For me information see zenity --help-progress.
对于我的信息,请参阅zenity --help-progress。
回答by moe
Try this,
尝试这个,
sleep 5|tee >(zenity --progress --pulsate --no-cancel --auto-close --text="Please wait...")

