#!/bin/bash cd $HOME/Videos/ SavePath=$(zenity --file-selection --save --confirm-overwrite) echo "Saving video to $szSavePath" INFO=$(xwininfo -frame) WIN_GEO=$(echo "$INFO"|grep -e "Height:" -e "Width:"|cut -d\: -f2|tr "\n" " "|awk '{print $1 "x" $2}') WIN_POS=$(echo "$INFO"|grep "upper-left"|head -n 2|cut -d\: -f2|tr "\n" " "|awk '{print $1 "," $2}') ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $WIN_GEO -r 15 -i :0.0+$WIN_POS -r 15 -acodec pcm_s16le -sameq "$SavePath.avi" echo "$WIN_GEO -i :0.0+$WIN_POS -acodec" echo "$WIN_POS"