User Interface

Information about the Mandolin Creek User Interface (MCUI) scripts

Mandolin Creek User Interface

The MCSH package includes the Mandolin Creek User Interface (MCUI) script libraries. The MCUI libraries provide an abstract Bash API for prompting users with information and collecting their input.


By using the MCUI libraries, MSCH components may interact with the user through many different possible implementations. These implementations fall into four broad categories:

  • Command Line Interface (CLI)
  • Textual User Interface (TUI)
  • Graphical User Interface (GUI)
  • Pen User Interface (PUI)


A CLI implementation provides basic line-oriented input and output support. The CLI must be used when executing without a terminal (e.g. as a sink in a command pipeline).

  • cli - uses echo and read shell built-ins


A TUI provides a text-based "graphical" windowing interface for interactive terminal use. These provide a better experience for users than a CLI implementation, but they do not look as nice as a modern GUI.

  • dialog - uses ncurses library
  • whiptail - uses newt library TODO


These graphical systems represent the state of the art

  • X windows
    • kdialog - uses Qt/KDE libraries
    • gdialog - uses GTK+/Gnome libraries (see the zenity package) TODO
  • Apple MacOS TODO
  • Microsoft Windows TODO


A PUI provides a user experience for mobile devices, tablets, and other touch-based devices.

  • Is there such a thing, similar to dialog and friends? If not, invent it. TODO

Automatic Detection

The MCUI library will transparently select the best implementation to use, depending on its current execution context. Presently, the software detects the following contexts in the order that they appear here:

  1.  X - If DISPLAY is set, MCUI will use the best available GUI backend.
  2. Terminal - If the controlling terminal is interactive, then MCUI will use the best TUI backend.
  3. Batch  - MCUI will use the best CLI backend.

Manual Selection

If this process does not result in the correct backend being selected, then you may select a specific library by setting mcui_backend in your environment or configuration file(s). When set, the automatic detection process will be skipped.


The mcui library provides the public programming interface. Scripts that utilize MCUI should only use the functions available directly in the main interface library. Conversely, functionality located inside mcui/* should only be used indirectly through the public interfaces.


  • mcui - Mandolin Creek UI public interface support


  • mcui/cli - MCUI backend for readline (CLI) support
  • mcui/dialog - MCUI backend for dialog (TUI) support
  • mcui/kdialog - MCUI backend for kdialog (GUI) support

Support Libraries

  • mcui/input - CLI input support


The MCUI libraries presently have a fairly clear and present task list. These tasks will be outlined and priorities briefly in this section. 


  • More input functions
    • Listbox
    • Combobox
    • Tree select
    • Calendar


  • cli
    • add missing callpoints as stubs
    • implement stubs
  • dialog
    • add missing call.points as stubs
    • implement stubs
  • kdialog
    • implement stubs
  • More backends
    • X/Gnome: zenity
    • X/GTK+: whiptail
    • MacOS: ?
    • Windows: ?