1 |
Hello, |
2 |
|
3 |
I've been converting myself over to console applications when possible |
4 |
now. I think it has a sleek look, and it ought to reduce my overhead. |
5 |
|
6 |
So on my mutlimedia workspace, I'd considered running a nearly full |
7 |
screen terminal of alsamixer with a command line music player in a |
8 |
smaller terminal that is normally on top. |
9 |
|
10 |
However, for my pseduo-transparent terminals, this was a major eyesore |
11 |
to have a solid black background for alsamixer. Before I investigated |
12 |
other mixer option, google fu could produce a patch for alsa-utils to |
13 |
make alsamixer run transparent. |
14 |
|
15 |
So, with this patch in hand, then I could easily make a local overlay |
16 |
of alsa-utils, patch the ebuild, and get my desired result. |
17 |
|
18 |
The patch isn't for the latest ~x86 alsa-utils, so I may need to tweak |
19 |
it for more recent versions. |
20 |
|
21 |
My question is if anyone is going to accept this as a reasonable |
22 |
"feature" addition to alsa-mixer on the main portage tree. I assume |
23 |
perhaps not, but I can't really see almost any advantage of the forced |
24 |
black background. If you want a black background, I say run the |
25 |
terminal that way. |
26 |
|
27 |
I didn't make the patch, so I have no intention to take the credit |
28 |
myself, but I didn't want to look like a dunce on bugzilla, but I've |
29 |
never submitted a feature request that didn't make me look like a |
30 |
dunce, hence polling opinion here. |
31 |
|
32 |
You can see the patch below. |
33 |
|
34 |
In any case, of course ebuild patching >> plugins |
35 |
|
36 |
~daid |
37 |
|
38 |
This idea came from |
39 |
https://www.prof-maad.org/blog/2009/11/11/transparent-alsamixer/ (and |
40 |
the website had some apparent security issues the other week when I |
41 |
found this, just fyi). |
42 |
|
43 |
daid@flux /usr/local/portage/media-sound/alsa-utils/files $ cat |
44 |
alsa-utils-1.0.20-transparency.patch |
45 |
--- alsa-utils-1.0.20/alsamixer/alsamixer.c 2009-05-06 15:07:24.000000000 +0800 |
46 |
+++ alsa-utils-1.0.20-profmaad1/alsamixer/alsamixer.c 2009-11-11 |
47 |
21:33:14.242278621 +0800 |
48 |
@@ -150,7 +150,7 @@ |
49 |
#define MIXER_CBAR_STD_HGT (10) |
50 |
#define MIXER_MIN_Y (MIXER_TEXT_Y + 6) /* abs minimum: 16 */ |
51 |
|
52 |
-#define MIXER_BLACK (COLOR_BLACK) |
53 |
+#define MIXER_BLACK (-1) |
54 |
#define MIXER_DARK_RED (COLOR_RED) |
55 |
#define MIXER_RED (COLOR_RED | A_BOLD) |
56 |
#define MIXER_GREEN (COLOR_GREEN | A_BOLD) |
57 |
@@ -320,7 +320,9 @@ |
58 |
dc_fg[n] = f; |
59 |
dc_attrib[n] = a; |
60 |
dc_char[n] = c; |
61 |
- if (n > 0) |
62 |
+ if(b==-1) |
63 |
+ init_pair (n, dc_fg[n] & 0xf, b); |
64 |
+ else if (n > 0) |
65 |
init_pair (n, dc_fg[n] & 0xf, b & 0x0f); |
66 |
} |
67 |
|
68 |
@@ -339,6 +341,7 @@ |
69 |
mixer_init_draw_contexts (void) |
70 |
{ |
71 |
start_color (); |
72 |
+ use_default_colors(); |
73 |
|
74 |
mixer_init_dc ('.', DC_BACK, MIXER_WHITE, MIXER_BLACK, A_NORMAL); |
75 |
mixer_init_dc ('.', DC_TEXT, MIXER_YELLOW, MIXER_BLACK, A_BOLD); |