jkgeyti
jkgeyti

Reputation: 2404

Pretty shell script (menus, images, antialias, 1080p, colors, fade effects etc.)?

I've created a couple of very simple bash scripts for a home-made games arcade (input configuration, updating stuff etc). I've got a launcher, so it's not a problem to direct the user to run the wanted shell script, but while running a bash script functionality-wise gives me everything I need, the default low-res text-on-black look scares the end user.

What is the simplest way to "prettify" fullscreen shell scripts? Something that'll run the script in 1080p, use bigger bubbly antialiased fonts, add a fancy animated background etc., but still pretty much lets me stick to write good-old shell scripts?

I guess another way to ask is: Does a prettier, more modern GUI-looking alternative to whiptail exist?

I am running from the terminal, so the GUI library it would have to be as fully self-contained as possible.

Upvotes: 3

Views: 1467

Answers (2)

enrico.bacis
enrico.bacis

Reputation: 31524

You could use python with the library Gooey that makes easy to turn CLI applications to GUI:

Gooey

It can be customized and it takes only one line for the magic to happen:

from gooey import Gooey

@Gooey      <--- all it takes! :)
def main():
  # rest of code

Upvotes: 1

Etan Reisner
Etan Reisner

Reputation: 81042

The ability of a shell script to display a quit within the terminal window itself is limited entirely to the graphical capabilities of the terminal (and to what termcap/terminfo has support for).

Most terminals max out at 256 colors (though supposedly konsole has support for arbitrary RGB colors somehow).

Control over font sizing/etc. from the shell is limited to the escape sequences that the terminal is willing to respond to (and I don't know if those are at all standard or discoverable at runtime).

The best option for this might be to have your script re-exec itself in a new terminal window to which it passes appropriate arguments to control font selection, window geometry, color selection, etc.

That being said even reliably doing that isn't necessarily the easiest thing in the world (I'm not sure how portable the command line options are between different terminal emulators or how many more advanced features they expose).

Upvotes: 1

Related Questions