Brian F. Feldman wrote in list.freebsd-hackers:
> I envision something like the following being available in /etc/rc,
> since there are many people who set mixer default values at startup in
> some random way. It would be nice to provide an easy way to do this.
> I'd like to get a vote on whether this should be added or not.
>
> I'd do something like the following:
>
> if [ -n "$mixer_device" ]; do
> mixer="mixer -f $mixer_device"
> else
> mixer="mixer"
> done
> for cf in `$mixer | cut -d' ' -f2` recsrc; do
> if eval [ -n "mixer_$cf" ]; then
> eval \$mixer \$cf \$mixer_$cf
> fi
> done
I'd like to propose a different approach. This is a slight
modification of what I do on my own boxes (using a script in
/usr/local/etc/rc.d).
rc.conf (example):
mixer_enable="YES" # (default = NO)
mixer_config="/etc/mixer.conf" # (default)
mixer_device="/dev/mixer" # (default)
mixer.conf (example):
# some comment
vol 90
synth 50 # more comments...
bass 75
treble 50
mic 0
line 50
cd 80
speaker 0
igain 50
ogain 70
rc:
if [ "X${mixer_enable}" != X"NO" -a -f "${mixer_config}" ]; then
echo -n ' mixer'
slots=`mixer -f ${mixer_device} | cut -d' ' -f2 | tr '\n' '|'`recsrc
sed 's/#.*$//' ${mixer_config} | egrep "$slots" | xargs mixer -f
${mixer_device}
fi
Just my 0.02 Euro...
Regards
Oliver
--
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:[email protected])
"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
(Terry Pratchett)
To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-hackers" in the body of the message