175584Sru#!/bin/sh 275584Sru#- 375584Sru# SPDX-License-Identifier: CC0-1.0 475584Sru# 5114402Sru# Written in 2021 by Alfonso Sabato Siciliano. 6114402Sru# 7114402Sru# To the extent possible under law, the author has dedicated all copyright 8114402Sru# and related and neighboring rights to this software to the public domain 9114402Sru# worldwide. This software is distributed without any warranty, see: 10114402Sru# <http://creativecommons.org/publicdomain/zero/1.0/>. 11114402Sru 12114402Sru: ${BSDDIALOG_ERROR=255} 13114402Sru: ${BSDDIALOG_OK=0} 14114402Sru: ${BSDDIALOG_CANCEL=1} 15114402Sru: ${BSDDIALOG_ESC=5} 16114402Sru 17114402SruTIME=$(./bsddialog --title " timebox " --timebox "Hello World!" 8 25 \ 18114402Sru3>&1 1>&2 2>&3 3>&-) 19114402Sru 20114402Srucase $? in 21114402Sru $BSDDIALOG_ERROR ) 22114402Sru exit 1 23114402Sru ;; 24114402Sru $BSDDIALOG_ESC ) 25114402Sru echo "[ESC]" 26114402Sru ;; 27114402Sru $BSDDIALOG_CANCEL ) 28114402Sru echo "[Cancel]" 29114402Sru ;; 30114402Sru $BSDDIALOG_OK ) 31114402Sru echo "[OK] $TIME" 32114402Sru ;; 33114402Sruesac 34114402Sru