#!/bin/bash DIR="$HOME/.spy" LOG_MONITOR="$DIR/monitor`/bin/date +%Y%m%d%H%M`.ogg" if [ ! -d $DIR ]; then mkdir $DIR fi # Get sink monitor: MONITOR=$(pactl list | egrep -A2 '^(\*\*\* )?Source #' | \ grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1) echo "set-source-mute ${MONITOR} false" | pacmd >/dev/null parec -d "$MONITOR" |oggenc -b 192 -o $LOG_MONITOR --raw - &