ubuntuusers.de

Titel:
Audioprofile umschalten
Autor:
DSIW
Datum:
17. März 2011 20:12
Aktionen:
Code:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
ACTIVE_PROFILE=`pactl list | tail -n 1 | cut -d ' ' -f 3`
echo "active Profile: $ACTIVE_PROFILE"

PREFIX="set profile:    "
PROFILEA="output:analog-stereo"
PROFILED="output:hdmi-stereo"

function setA () {
	pactl set-card-profile 0 $PROFILEA
	echo "$PREFIX$PROFILEA"
}

function setD () {
	pactl set-card-profile 0 $PROFILED
	echo "$PREFIX$PROFILED"
}

if [ $ACTIVE_PROFILE == $PROFILEA ]; then
	setD
elif [ $ACTIVE_PROFILE == $PROFILED ]; then
	setA
else
	setA
fi