3

I'm trying to create a simple bash script that I can run over ssh that will display some basic system information using ncurses and the dialog command. I've tried two approaches so far:

1) Run dialog --infobox in a while loop with a 1 second sleep between redraws.

Problem: This displays properly however there is a brief flicker between redraws that I would like to eliminate

2) Run dialog --tailbox once and have it display the contents of a pre-populated system info file.

Problem: Unless the number of lines in the input file changes, the dialog doesn't update.

I'm wondering if there is a better way to draw a dialog box with constantly updating information. I'm also open to any other non ncurses suggestions if there is a better/easier way of doing this.

I will be displaying this through SSH on a small tablet so I would like to make it as visually appealing as possible while remaining within the terminal.

1

I've recently discovered that using escape characters might be the easiest way to reliably accomplish this task.

This article outlines the purpose of each escape character and how to combine them to draw simple bash dialogs.

http://top-scripts.blogspot.com/2011/01/power-of-echo-command-bash-console.html

Thanks for the help thus far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.