diff record-app @ 0:e85e3470a41e

Initial commit of useful scripts
author IBBoard <dev@ibboard.co.uk>
date Sat, 02 Aug 2014 19:31:02 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/record-app	Sat Aug 02 19:31:02 2014 +0100
@@ -0,0 +1,33 @@
+#! /bin/bash
+
+echo "Does not work yet" >&2
+exit 1
+
+
+
+MYCMD=$1
+
+if [ -z "$MYCMD" ]; then
+	echo "Usage: $0 <app-name>" >&2
+	exit 1
+fi
+
+INDEX=''
+pacmd list-sink-inputs | while read line; do
+	if echo "$line" | grep -qE "^index:"; then
+		index=$(echo "$line" | cut -f2 -d:)
+	elif echo "$line" | grep -qE "^client:.*$MYCMD"; then
+		INDEX=$index
+	fi
+done
+
+if [ -z "$INDEX" ]; then
+	echo "Unable to find stream for $MYCMD" >&2
+	exit 1
+fi
+
+
+# TODO: Work out null sink stuff
+pactl load-module module-null-sink sink_name=steam
+pactl move-sink-input $INDEX steam
+parec -d steam.monitor | oggenc -b 192 -o steam.ogg --raw -
\ No newline at end of file