views:

186

answers:

2

I'm looking for dialog widgets for the Linux Console (not X, but the "terminal" console) that would show a countdown in seconds next to a widget that might be a menu list or a textbox. Ideally this might be a standalone program, like dialog, that is supplied parameters to control its behaviour. When the countdown reaches 0, the selected value of the widget is returned. There could be a default value in case no human is present (or the human prefers the default). The boot loaders like grub and lilo can do this already, pretty much. I looked through the dialog man page and couldn't find this feature set. Is there a similar tool somewhere that implements a countdown and query?

A: 

I believe Ncurses is what you're looking for.

Steve K
Thank you for responding. To code it, I'd agree. I was hoping someone had done it already.
Paul
+1  A: 

I suggest you read the dialog man page. Oh, you already did, you say? Then what’s wrong with:

--pause text height width seconds

A pause box displays a meter along the bottom of the box. The meter indicates how many seconds remain until the end of the pause. The pause exits when timeout is reached or the user presses the OK button (status OK) or the user presses the CANCEL button or Esc key.

Bombe
Thanks for pointing bringing my attention to this. However, pause is a widget that displays a message, a countdown, and OK/Cancel. It is not an attribute or modifier to other widgets. So it won't implement a menu with a countdown. --timeout 30 will add a 30sec timeout to a menu but there is no indication of progress.
Paul