Subversion Repositories livecd

Rev

Rev 1 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 169
1
#/!bin/bash
1
#/!bin/bash
2
#
2
#
3
# unmute all mixers and set volumes to $1
3
# unmute all mixers and set volumes to $1
4
#
4
#
5
# Urs Beyerle, PSI
5
# Urs Beyerle
6
#
6
#
7
 
7
 
8
AMIXER=$( which amixer )
8
AMIXER=$( which amixer )
9
if [ "$AMIXER" = "" ]; then
9
if [ "$AMIXER" = "" ]; then
10
    echo "Sorry command amixer not found."
10
    echo "Sorry command amixer not found."
11
    exit 1
11
    exit 1
12
fi
12
fi
13
 
13
 
14
VOLUME=$1
14
VOLUME=$1
15
[ "$VOLUME" = "" ] && VOLUME=60
15
[ "$VOLUME" = "" ] && VOLUME=60
16
VOLUME="${VOLUME}%"
16
VOLUME="${VOLUME}%"
17
echo -n "Set all mixer controls to $VOLUME ... "
17
echo -n "Set all mixer controls to $VOLUME ... "
18
 
18
 
19
# search mixer controls and unmute them
19
# search mixer controls and unmute them
20
 
20
 
21
$AMIXER scontrols | cut -d"'" -f 2 | while read mixer; do
21
$AMIXER scontrols | cut -d"'" -f 2 | while read mixer; do
22
    $AMIXER set "$mixer" $VOLUME unmute >/dev/null 2>/dev/null
22
    $AMIXER set "$mixer" $VOLUME unmute >/dev/null 2>/dev/null
23
done
23
done
24
 
24
 
25
echo "done."
25
echo "done."