The recent change to add the background config broke the color setup
via the config file due. Fix the regression by restoring the
initialization order back again, and changing the logic for the
default background color to be re-initializing color pairs instead.
Link: https://github.com/alsa-project/alsa-utils/issues/137
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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>
This commit is a preparation for the configuration file parser.
The `int attr_*` variables have been moved into a separate struct.
Members of that struct are alphabetically ordered, so an attribute can
later be accessed by its name.
Added `int get_color_pair(short fg, short bg)` for returning or
creating a color pair number.
Added call to `use_default_colors()` for enabling access to the
terminal's default color (-1).
Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
For multichannel mixer controls, add the channel name to each screen
control.
Also make some other small changes.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>