Real time system info script using ncurses and dialog

6,438

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.

Share:
6,438

Related videos on Youtube

Andrew Munro
Author by

Andrew Munro

Updated on September 18, 2022

Comments

  • Andrew Munro
    Andrew Munro almost 2 years

    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.

    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 12 years
    • bsd
      bsd over 12 years
      have you tried using the --sleep <secs> arg to dialog instead of in the while loop?
    • Andrew Munro
      Andrew Munro over 12 years
      This is definitely a cleaner approach. Unfortunately the flicker issue is still there. Thanks