Click to See Complete Forum and Search --> : write output of aumix -q to a file


Hayl
12-03-2002, 04:25 PM
i want to read the output of the following command and pick out the current volume level and write it to a file

[code]
ddicks@linuxbox:~$ aumix -q
vol 8, 8
pcm 48, 48
speaker 67, 67
line 67, 67, P
mic 0, 0, R
cd 67, 67, P
igain 1, 1, P
ogain 67, 67
line1 67, 67, P
dig1 67, 67
phin 67, 67, P
phout 67, 67
video 67, 67, P
[/quote]

any idea how to do this?

binaryDigit
12-03-2002, 05:03 PM
aumix -q | grep vol > somefile

Hayl
12-03-2002, 05:09 PM
ok cool now how to get rid of all except one of the 8s ?

what i want is to get one of the 8s as the value of a variable in my script. the numebr could be anything so it can't be just the one digit either :(

binaryDigit
12-03-2002, 06:24 PM
aumix -q | grep vol | cut -f 3 -d ' ' > somefile

by the way. this might not be the best possible solution, but it works

Hayl
12-03-2002, 06:43 PM
thx

Hayl
12-03-2002, 07:10 PM
well after all that i realized there is an easier way using aumix -L and aumix -S. (what i was trying to accomplish was to have it rememebr the old volume - i am making the "mute" button on my multimedia keyboard work properly as opposed to it just setting volume to zero).

#! /bin/bash
# setmute
# mutes /dev/mixer using the aumix app
#
# written by: dale_d@telusplanet.ent
#
if [ -e ~/.muteon ]; then
rm ~/.muteon
aumix -L
exit 0
else
aumix -q > ~/.muteon
aumix -S
aumix -v 0
exit 0
fi
exit 1