Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# this bit came from youtube.com/watch?v=_XDa1ahl7fw
INFO=$(xwininfo)
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' )
AUDIO_INPUT="-f alsa -i hw:0,0 -ac 2"
VIDEO_INPUT="-f x11grab -r 30 -s $WIN_GEO -i :0.0+$WIN_XY"
#AUDIO_CODEC="-acodec pcm_s16le"