如何在Linux中显示一个bash脚本的GUI消息框? [英] How to show a GUI message box from a bash script in linux?

查看:140
本文介绍了如何在Linux中显示一个bash脚本的GUI消息框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu linux下编写了一些小小的bash脚本。我希望能够从GUI运行它们,而不需要终端窗口来输入任何输入或查看任何输出。



到目前为止,唯一需要的输入是密码sudo - 和gksudo处理罚款。
但是我还没找到一个简单的方法来显示消息框。是否有某种'gkmessage'命令可用?我更喜欢默认的Ubuntu安装中提供的东西,但我不介意在必要时安装新的软件包。

我相信 Zenity 会做你想做的。它专门用于从命令行显示GTK对话框,它可以作为 Ubuntu软件包


I'm writing a few little bash scripts under Ubuntu linux. I want to be able to run them from the GUI without needing a terminal window to enter any input or view any output.

So far the only input required is a password for sudo - and gksudo handles that fine. But I haven't found an easy way to show a message box yet. Is there some kind of 'gkmessage' command available? I'd prefer something present in a default Ubuntu install, but I don't mind installing a new package if necessary.

解决方案

I believe Zenity will do what you want. It's specifically designed for displaying GTK dialogs from the command line, and it's available as an Ubuntu package.

这篇关于如何在Linux中显示一个bash脚本的GUI消息框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆