Introduction to TUI Programming using bsddialog

Thursday 13:00 - 16:00

Shell scripts have a bad reputation when it comes to usability and eye candy. Modern users find a blinking cursor on a a black screen leaves a lot to be desired when having to interact with a shell script. In this tutorial, we will create shell scripts that look like a GUI application: with buttons to press, input fields, select boxes and animated progress bars. These so called TUI (text user interfaces) programs still use shell script functionality as the backend, but are lightweight enough to not introduce too much overhead. Users will appreciate the ease of use of your shell scripts and you can rely on them to give you the data and visualizations you to need. At the same time, the TUI application is not difficult to learn and implement into existing scripts.

There have been a number of such libraries in the past. The most prominent one is ncurses, which is a newer implementation of System V Release 4.0 (SVr4) curses, which itself is an enhancement over the discontinued 4.4 BSD curses. The modern BSD version is bsddialog, created by Alfonso Sabato Siciliano. This is what we are going to use in this tutorial.


Tutorial contents:


The goal of this tutorial is to provide participants with enough information about bsddialog to write their own TUI applications to spice up their user-visible shell scripts. We will not do development in the bsddialog library, but will use most of its components. The intended audience is beginners who have basic familiarity with shell programs.

Attendees should bring a laptop with a BSD system available to follow along with the examples and exercises. People who want to make changes to the FreeBSD installer or the ports dialogues may also find this tutorial interesting. Even though we don't cover these in detail, the content will get people familiar enough to start working in these areas.

Slides and material will be provided to the audience. The course is based on parts of my "Unix for Developers" lecture at the University of Applied Sciences, Darmstadt, Germany.