06-16-2003
My humble bare knowledge and incomplete understanding tells me you would like to do some ncurses-like thing. However, I don't think ncurses libraries can be driven by a shell script. Needs some C programming i think.
Otherwise, I think the only way left is to use embed ANSI color sequences but it just adds some color and you can't have effects like the use of arrow keys to jump between and highlight items etc.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm working on a script for a basic menu with four options. The first option for the menu asks a user to put in anyone's user name and is supposed to display the user's home directory. If a user does not enter a name, then their own home directory should be displayed. The second menu option is... (0 Replies)
Discussion started by: sinjin
0 Replies
2. Shell Programming and Scripting
So, I need help writing a Menu script in UNIX.
First how can I use letters for the options instead of numbers?
Also, is there any templates out on the web I can use? (2 Replies)
Discussion started by: Gboy
2 Replies
3. Shell Programming and Scripting
Hi there, I am new to Unix and at the moment
I am trying to solve my assignment that is to create a script for the program
to prompt user to type three codes,
from user point of view it should be done by
typing codes separating them by spaces.
Then program displays a menu with these three... (2 Replies)
Discussion started by: Dannel
2 Replies
4. Shell Programming and Scripting
Hi , I have a menu driven script as shown below
echo ""
echo "*** 1 - option 1 " echo "*** "
echo "*** 2 - option 2 "
echo "*** 3 - option 3 "
... (3 Replies)
Discussion started by: ultimatix
3 Replies
5. Shell Programming and Scripting
hi guys, how would you do the following? I have a menu with 5 options in my shell script:
1. Run function 1 against files
2. Run function 2 against files
3. Run function 3 against files
4. Run function 4 against files
5. Run function 5 against files
I'd like to be able to run multiple... (10 Replies)
Discussion started by: rich@ardz
10 Replies
6. Shell Programming and Scripting
Problem:
I am trying to create a menu in a menu script and I am running into an issue with the calculator portion of the script. I am first presented with the ==Options Menu== which all 5 options working correctly. Now comes the fun part. I select option 1 which takes me to my ==Calculator... (1 Reply)
Discussion started by: iDdraig
1 Replies
7. Shell Programming and Scripting
hi all i am a newbie to this
is there any examples on creating a main menu with 3 sub menu
main menu -> option a , b and c
a menu -> option 1 ,2 and 3
b menu -> option 1 ,2
c menu -> option 1 ,2
i am getting headache as my code kept getting unexpected EOF
---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies
8. Shell Programming and Scripting
Hello,
I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file.
For example;-
In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output... (4 Replies)
Discussion started by: spradha
4 Replies
9. UNIX for Beginners Questions & Answers
I installed CentOS 8 with Gnome 3.28.2 and I noticed that the "switch user" menu item disappeared from under the system menu of Gnome classic (Both X11 & Wayland). I checked google and this problem seems to have a history going back several releases of Gnome.
Unfortunately, I never found a... (1 Reply)
Discussion started by: bodisha
1 Replies
LEARN ABOUT OPENDARWIN
default_colors
default_colors(3X) default_colors(3X)
NAME
use_default_colors, assume_default_colors - use terminal's default colors
SYNOPSIS
#include <curses.h>
int use_default_colors(void);
int assume_default_colors(int fg, int bg);
DESCRIPTION
The use_default_colors() and assume_default_colors() functions are extensions to the curses library. They are used with terminals that
support ISO 6429 color, or equivalent. These terminals allow the application to reset color to an unspecified default value (e.g., with
SGR 39 or SGR 49).
Applications that paint a colored background over the whole screen do not take advantage of SGR 39 and SGR 49. Some applications are
designed to work with the default background, using colors only for text. For example, there are several implementations of the ls program
which use colors to denote different file types or permissions. These "color ls" programs do not necessarily modify the background color,
typically using only the setaf terminfo capability to set the foreground color. Full-screen applications that use default colors can
achieve similar visual effects.
The first function, use_default_colors() tells the curses library to assign terminal default foreground/background colors to color number
-1. So init_pair(x,COLOR_RED,-1) will initialize pair x as red on default background and init_pair(x,-1,COLOR_BLUE) will initialize pair x
as default foreground on blue.
The other, assume_default_colors() is a refinement which tells which colors to paint for color pair 0. This function recognizes a special
color number -1, which denotes the default terminal color.
The following are equivalent:
use_default_colors();
assume_default_colors(-1,-1);
These are ncurses extensions. For other curses implementations, color number -1 does not mean anything, just as for ncurses before a suc-
cessful call of use_default_colors() or assume_default_colors().
Other curses implementations do not allow an application to modify color pair 0. They assume that the background is COLOR_BLACK, but do
not ensure that the color pair 0 is painted to match the assumption. If your application does not use either use_default_colors() or
assume_default_colors() ncurses will paint a white foreground (text) with black background for color pair 0.
RETURN VALUE
These functions return the integer ERR upon failure and OK on success. They will fail if either the terminal does not support the
orig_pair or orig_colors capability. If the initialize_pair capability is found, this causes an error as well.
NOTES
Associated with this extension, the init_pair(3X) function accepts negative arguments to specify default foreground or background colors.
PORTABILITY
These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any
code depending on them be conditioned using NCURSES_VERSION.
SEE ALSO
curs_color(3X), ded(1).
AUTHOR
Thomas Dickey (from an analysis of the requirements for color xterm for XFree86 3.1.2C, February 1996).
default_colors(3X)