Need help or suggestions on drawing a cmd-line GUI in bash.
I'm not sure entirely how to explain what I'm trying to do, but in a nutshell:
I have a list of text files, each containing a couple of snippets of information. I'd like to create a shell script which reads all of those files and prints them out in a coherent format, wherein the user can choose a file to edit, delete, etc... I'm envisioning something akin to the pine interface - a box, a list of choices inside of the box, and the user can use arrow keys to choose an item and a command or two to choose what they'd like to do with it. Most of this I can handle, although I know the final product won't be quite so slick-looking. But...how do I change what's displayed in one area without redrawing the whole screen? Like, if the user scrolls down the list of items, all I want to move is the list of items. Using up their PuTTy scrollback buffer to redisplay the entire window each time one line changes seems really inelegant. I've seen someone do this in C ...I'd like to do this in Bash if at all possible. Thoughts/suggestions? |
have you checked out ncurses?
|
If you want to do this in only Bash then AFAIK the closest you can get to anything resembling a menu is select statements and tput for wipes. If you allow external apps check out dialog.
|
Hmm, I'd only previously heard of ncurses in the way of resolving dependancies, but from what I just gleaned from a google search, it looks promising.
Thank you, I appreciate the pointer! |
dialog is what you want. It uses the ncurses libs.
|
here's a silly script of mine
i usually ls into xless and cut and paste. Code:
#!/bin/ksh |
All times are GMT -5. The time now is 06:21 AM. |