alsa-utils/alsamixer/colors.h
Takashi Iwai 5d4442b2cf alsamixer: Allow setting the default background color in config
The recent commit c867aa8a84 ("alsamixer: use background color
instead of COLOR_BLACK") changed the behavior of alsamixer to take the
system default background color instead of black.  This caused
problems on the terminal setups that have bright background colors,
e.g. yellow is very hard to read.

It could be "fixed" by setting up the color configurations in
~/.config/alsamixer.rc, but this needs to change the all colors in
every element, which is pretty cumbersome.  Instead, this patch
extends the config set command to allow user to specify the default
background color.  A user like me can create their own
~/.config/alsamixer.rc file containing the line

  set background black

and the old good black background is back again.

Note that, for achieving the above, we also had to shuffle the
function call order, to parse the config at first, then initialize
curses.  This shouldn't matter for other behavior.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-10-20 17:24:35 +02:00

43 lines
729 B
C

#ifndef COLORS_H_INCLUDED
#define COLORS_H_INCLUDED
#define TRICOLOR_VOLUME_BAR
struct attributes {
// Alphabetically sorted
#ifdef TRICOLOR_VOLUME_BAR
int ctl_bar_hi;
#endif
int ctl_bar_lo;
#ifdef TRICOLOR_VOLUME_BAR
int ctl_bar_mi;
#endif
int ctl_capture;
int ctl_frame;
int ctl_inactive;
int ctl_label;
int ctl_label_focus;
int ctl_label_inactive;
int ctl_mark_focus;
int ctl_mute;
int ctl_nocapture;
int ctl_nomute;
int errormsg;
int infomsg;
int menu;
int menu_selected;
int mixer_active;
int mixer_frame;
int mixer_text;
int textbox;
int textfield;
};
extern struct attributes attrs;
extern short background_color;
void init_colors(int use_color);
int get_color_pair(short fg, short bg);
#endif