5

I am using bunch of scripts all the time and I'm getting tired of always typing the commands in terminal, so I would want to write some sort of user interface. Think of something like "aptitude" with live updates through a loop something like "top". It is a VPS so I cant do it graphical.

All I need is simple menus, moving between items with arrows and such. Is there a good tutorial, is it even possible with bash?

Thanks in advance for your time.

nana
  • 4,426
  • 1
  • 34
  • 48

2 Answers2

4

Have a look at the dialog command. It allows you to create visual UI widgets that can handle keyboard (and even mouse) input.

You have options for creating input boxes, menus, text boxes, check boxes and many others.

Think of a mc - like interface, although mc itself is a little more than this.

Costi Ciudatu
  • 37,042
  • 7
  • 56
  • 92
  • Thanks a lot, it looks great. I was hoping there were some commands in bash, so I could get away with not apt-getting another package. If you know of any other solution where I it would be all done just in BASH please tell me. Otherwise thanks a lot i will use this. – nana May 16 '11 at 15:41
  • I know of nothing with less requirements and close as powerful, unfortunately. But with bash alone you can do quite a lot if you're not afraid of manual coding (and you're ready to handle terminal escape sequences yourself). – Costi Ciudatu May 16 '11 at 15:49
  • Alright then, lets have a look at those terminal escape sequences :D Thanks a lot for your help. – nana May 16 '11 at 15:55
1

It is a VPS so I cant do it graphical

Not strictly true. Have you ever heard of remote desktop technology? For example, X2Go.

Admittedly, many graphical apps and desktop environments might be too heavyweight to run comfortably in a small VPS. But it is theoretically possible at least.

Robin Green
  • 32,079
  • 16
  • 104
  • 187
  • Actually that is what I was trying to figure out from the beginning. Every single person I talked to adviced me against it though. I thought it would be great to have headless linux box sitting on the backbone. I also tried installing full blown ubuntu desktop package on it and it somehow failed, so if you want to help it would be welcome :) – nana May 16 '11 at 15:35
  • How much RAM do you have in your VPS? If GNOME failed you might want to try something more lightweight, like XFCE or xmonad. But actually, you don't need a desktop environment at all, just to run graphical apps. – Robin Green May 16 '11 at 15:39
  • I have about 1500MB RAM on the VPS. – nana May 16 '11 at 15:42
  • How would that work? I would just install the graphical backend system and then connect to it from Win or Ubuntu desktop? What client would I use? – nana May 16 '11 at 15:43
  • Awesome, that's more than I have in my PC! To be honest with you I would just run the graphical program directly with `ssh -Y hostname progname`. It's slow but at least it's convenient - if you need more speed, you can then install something like X2Go, but that's slightly more work. – Robin Green May 16 '11 at 15:46
  • So.... I would just have to instal X3GO, or will I have to install something like Gnome or KDE too? – nana May 16 '11 at 15:56
  • To me it sounds logical to be forced to install soem sort of Window mode (sorry for the terminology, i am very new to linux) like KDE for example. Because right now my only UI is CLI and I don't think there is anything else installed on the VPS, it would just eat resources and space, correct? – nana May 16 '11 at 16:00
  • Yes, but like I said you could use a lighter alternative to KDE or GNOME, like XFCE. – Robin Green May 16 '11 at 16:50