0
|
1 #! /bin/bash
|
|
2
|
|
3 echo "Does not work yet" >&2
|
|
4 exit 1
|
|
5
|
|
6
|
|
7
|
|
8 MYCMD=$1
|
|
9
|
|
10 if [ -z "$MYCMD" ]; then
|
|
11 echo "Usage: $0 <app-name>" >&2
|
|
12 exit 1
|
|
13 fi
|
|
14
|
|
15 INDEX=''
|
|
16 pacmd list-sink-inputs | while read line; do
|
|
17 if echo "$line" | grep -qE "^index:"; then
|
|
18 index=$(echo "$line" | cut -f2 -d:)
|
|
19 elif echo "$line" | grep -qE "^client:.*$MYCMD"; then
|
|
20 INDEX=$index
|
|
21 fi
|
|
22 done
|
|
23
|
|
24 if [ -z "$INDEX" ]; then
|
|
25 echo "Unable to find stream for $MYCMD" >&2
|
|
26 exit 1
|
|
27 fi
|
|
28
|
|
29
|
|
30 # TODO: Work out null sink stuff
|
|
31 pactl load-module module-null-sink sink_name=steam
|
|
32 pactl move-sink-input $INDEX steam
|
|
33 parec -d steam.monitor | oggenc -b 192 -o steam.ogg --raw - |