Commit graph

10 commits

Author SHA1 Message Date
Jaroslav Kysela
dad2161d3c alsamixer: add -B,--black-background option
Fixes: https://github.com/alsa-project/alsa-utils/issues/176
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-02-10 13:36:23 +01:00
Takashi Iwai
40202a522a alsamixer: Fix regression in color setup
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>
2022-01-20 08:58:48 +01:00
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
Jaroslav Kysela
0a6b63a2c4 amixer/alsamixer: use sysdefault:<CARD> devices instead hw:<CARD>
The alsa-lib 1.2.5 introduced a new scheme for the default control
devices.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-04-06 20:25:58 +02:00
braph
89e746368c alsamixer: added configuration file parser
Added configparser.c and curskey.c:
  - Lines starting with arbitrary whitespace + '#' are comments
  - Words in a command name don't have a fixed order (toggle_mute is the
      same as mute_toggle)

Moved read_file() from textbox.c to utils.c, so configparser.c can make
use of it.

Added command line options:
  -f/-F to specify/disable configuration file
  -m/-M to enable/disable mouse

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-07-01 16:10:35 +02:00
Michael Forney
cb47f6dcf4 Avoid empty initializer list
To zero-initialize an object, use `{0}` instead.

Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:39:43 +01:00
Jaroslav Kysela
5622f3b09f alsamixer: Use isatty() to check the terminal (interactive) availability
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-03-22 13:27:26 +01:00
Jaroslav Kysela
4c09aaa5c1 alsamixer: Fix X-win related crash for PulseAudio plugin (bad linking)
A lot of reports that alsamixer crashes in X terminal when the PulseAudio
CTL plugin is activated were entered to the tracking systems.

I figured that there is a linking clash for the shutdown() function.
The shutdown() function in glibc is socket related, but the alsamixer code
redefines this function and appearently that under some linking
circumstances - which PA client invokes during the runtime dynamic linking
- the wrong function is called.

This patch, for safety, renames the shutdown() function from alsamixer
to app_shutdown(), but it might make sense to figure the real linking
culprit to avoid future surprises.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-11-02 17:27:47 +01:00
Clemens Ladisch
f2e9e9a5b0 alsamixer: remove obsolete e-mail
Tim Janik's e-mail address is no longer valid.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-11-10 10:14:53 +01:00
Clemens Ladisch
5b6b5fd14b alsamixer: show channel names for multichannel controls
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>
2009-05-25 10:26:22 +02:00