xfce / bash:shell脚本中的gui元素

我使用xfce作为默认窗口管理器进行了最小程度的安装。 是否有可能用简单的gui元素编写shell脚本? 或者我是否要安装其他东西(我不愿意这样做,我希望将已安装的软件包数量(大小)保持在最低限度)。

试试Zenity:

" Zenity allows you to display GTK+ dialogs from shell scripts". 

它非常简约,这里是依赖项,其中许多应该已经存在于xfce系统中:

 Depends: libc6 (>= 2.4), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.24.0), libgtk-3-0 (>= 3.0.0), libnotify4 (>= 0.7.0), libpango1.0-0 (>= 1.14.0), libwebkitgtk-3.0-0 (>= 1.3.10), libx11-6, zenity-common (= 3.2.0-0ubuntu1) 

另一个选择是yad

  YAD is a program that will display GTK+ dialogs, and return (either in the return code or on standard output) the users input. This allows you to present information, and ask for information from the user, from all manner of shell scripts. YAD is the fork of Zenity program. 

YAD(Yet Another Dialog)是Zenity的一个分支,有许多改进,例如自定义按钮,附加对话框,通知图标中的弹出菜单等等。 基本上你在Zenity中想要做的大部分内容都可以在YAD中找到:你可以拥有任意数量的按钮,每个按钮都有你想要的文本,一个非常漂亮的图标对话框。

YAD没有所有相同的对话框,例如 – error, – info, – items或–warning – 相反,它有一个–form对话框,您可以在其中添加所需的任何消息,按钮和图标。 它还包括–notification对话框,以便在通知区域中显示图标。 有关使用YAD的帮助,请参阅其中的示例部分[Wiki]( https://code.google.com/archive/p/yad/wikis/Examples.wiki

yad在存储库中可用于所有当前支持的Ubuntu版本,尽管像许多这些有用的软件包一样,如果在尝试安装之前尚未启用Universe存储库,则必须启用它。

资料来源:

man yad

http://www.webupd8.org/2010/12/yad-zenity-on-steroids-display.html

https://code.google.com/archive/p/yad/wikis/Examples.wiki

https://www.mankier.com/1/yad