The dialog Snapcraft part: Support presenting TUI dialogs to the users

This Snapcraft part definition ships the dialog package to the snap, allowing packagers to present TUI dialogs to the users.

This is normally used in CLI snaps to present a message or require user input in a relatively friendly user interface:

Also, see Inform users with custom dialogs.


This section documents the prerequisites for using this Snapcraft part:


This section documents the instructions on how to make use of this Snapcraft part:

  1. Merge the following part definition into the parts stanza of your snapcraft.yaml file:

      # This snapcraft part allows the creation of TUI dialogs
        plugin: nil
          - dialog
          # C header files
          - -usr/include
          # Static libraries(no dynamic libraries shipped in this
          # part
          - -usr/lib
          # Documentation(aside from the copyright declarations)
          - -usr/share/doc/dialog/README*
          - -usr/share/doc/dialog/changelog.*
          - -usr/share/doc/dialog/examples
          # Manual pages
          - -usr/share/man
          # Perl binding for Dialog
          - -usr/share/perl5
  2. In your launcher or other program, invoke the dialog utility as in the following example:

    dialog \
        --title 'Hello dialog(1) world' \
        --msgbox 'This is an example of the msgbox style dialog(1) dialog box' \
        0 0

    Refer to Ubuntu Manpage: dialog - display dialog boxes from shell scripts for more info on how to invoke the dialog utility.


Ubuntu Manpage: dialog - display dialog boxes from shell scripts