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.

Andrew Munro
  • 325
  • 1
  • 4
  • 9

1 Answers1

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.

Andrew Munro
  • 325
  • 1
  • 4
  • 9