DEV Community

Cover image for BSDDialog 0.0.1
Alfonso Siciliano
Alfonso Siciliano

Posted on

BSDDialog 0.0.1

BSDDialog is an utility to write a script with a Text User Interface. It can build widgets/dialogs: to show messages, to get input and to inform about a computation status.

Example to build a msgbox with Hello World!:

% bsddialog --msgbox "Hello World!" 8 20
Enter fullscreen mode Exit fullscreen mode

Hello World Example: a dialog with "Hello World!"

Of course, it is possible to use bsddialog in a shell script, "Yes-No Question" example:

#!/bin/sh

${BSDDIALOG_YES=0}
${BSDDIALOG_NO=1}

bsddialog --theme bsddialog --color --title " yesno " \
    --yesno "\nHello \Z3World\Zn!" 10 30

case $? in
    $BSDDIALOG_YES )
        echo "YES!"
        ;;
    $BSDDIALOG_NO )
        echo "NO!"
        ;;
esac
Enter fullscreen mode Exit fullscreen mode

Yes-No Question example


The utility is designed and developed mainly for FreeBSD, the first version 0.0.1 is out, please consider this a testing version, let me know any problem.

To install the port devel/bsddialog:

# cd /usr/ports/devel/bsddialog/ && make install clean
Enter fullscreen mode Exit fullscreen mode

To add the package:

# pkg install bsddialog
Enter fullscreen mode Exit fullscreen mode

To build from sources:

$ git clone https://gitlab.com/alfix/bsddialog.git
$ cd bsddialog
$ make
Enter fullscreen mode Exit fullscreen mode

Features:

% bsddialog --version
bsddialog 0.0.1 (libbsddialog 0.1-devel).
% bsddialog --help

Enter fullscreen mode Exit fullscreen mode

Terminal prints output "bsddialog --help"

  • Messages: infobox, msgbox, yesno.
  • Menus: radiolist, checklist, menu, treeview, buildlist.
  • Forms: inputbox, form, mixedform, passwordbox, passwordform,
  • Bars: gauge, pause, mixedgauge, rangebox.
  • Date and time: datebox, timebox.
  • Text: textbox.

The project has a list of examples, some screenshot, preview:

BSDDialog


BSDDialog is an open source project released under the term of the BSD 2 Clause License, repository: https://gitlab.com/alfix/bsddialog.

Happy Hacking!

Top comments (0)