I have a minimal installation with xfce as the default window manager. Is it somehow possible to write a shell script with simple gui elements? Or do I to install something else (which I am reluctant to do, I want to keep the number of installed packages (size) to a minimum).
2 Answers
Try Zenity:
" Zenity allows you to display GTK+ dialogs from shell scripts".
It's pretty minimalistic, here are the dependencies, many of these should already be present on an xfce system:
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)

- 34,222
- 9
- 81
- 93
Another option is 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) is a fork of Zenity with many improvements, such as custom buttons, additional dialogs, pop-up menu in notification icon and more. Basically most of the stuff you ever wanted to do in Zenity is available in YAD: you can have as many buttons as you want, each with the text you want, a really nice icons dialog.
YAD doesn't have all the same dialogs such as --error, --info, --question or --warning - instead, it has a --form dialog to which you can add whatever message, buttons and icons you want. It also includes the --notification dialog in order to show an icon in the notification area. For help on using YAD see the examples sections at it's [Wiki] (https://code.google.com/archive/p/yad/wikis/Examples.wiki)
yad
is available in the repositories for all currently supported versions of Ubuntu although like many of these useful packages you must enable the Universe repository if it's not enabled already prior to attempting installation.
Sources:
man yad
http://www.webupd8.org/2010/12/yad-zenity-on-steroids-display.html

- 36,023
- 25
- 98
- 183