diff options
Diffstat (limited to 'bin/guiscripts')
| -rwxr-xr-x | bin/guiscripts/record | 20 | 
1 files changed, 17 insertions, 3 deletions
diff --git a/bin/guiscripts/record b/bin/guiscripts/record index 778e02e..df4b6e6 100755 --- a/bin/guiscripts/record +++ b/bin/guiscripts/record @@ -11,6 +11,8 @@ lock="/tmp/record.lock"  # 	- xdotool: active  # 	- xdg-user-dir +audio= +  # $1: width  # $2: height  # $3: x @@ -30,10 +32,9 @@ record_cmd()  	herbe "started recording." &  	w=$(($3 + $3 % 2))  	h=$(($4 + $4 % 2)) -	ffmpeg               \ +	ffmpeg $audio        \  	    -v 16            \  	    -r 30            \ -	    -f pulse -ac 2 -i default   \  	    -f x11grab       \  	    -s "${w}x${h}"   \  	    -i ":0.0+$1,$2"  \ @@ -57,9 +58,21 @@ else  fi  mkdir -p "$dir" +if [ "$1" = "-a" ] +then +	audio="-f pulse -ac 2 -i default" +	shift +fi + +if [ "$1" = "-l" ] +then +	find vids/records/ -type f | sort | tail -n 1 +	exit +fi +  current=$(date +%F_%H-%M-%S) -[ "$1" ] && option="$1" || option="$(printf 'active\nwindow\npart\nstop\nfull\n' | commander -c)" +[ "$1" ] && option="$1" || option="$(printf 'active\nwindow\npart\nstop\nfull\naudio' | commander -c)"  case "$option" in      active)          record_cmd $(xwininfo -id "$(xdotool getactivewindow)" | @@ -82,5 +95,6 @@ case "$option" in          ;;      stop) kill "$(pgrep ffmpeg | xargs ps | grep 'x11grab' | awk '{print $1}')"; rm -f "$lock" ;;      full) record_cmd 0 0 1920 1080 $dir $current ;; +    audio) $0 -a; exit ;;      help|*) >&2 printf 'record [dir] (active|window|part|stop|full)\n' ;;  esac  | 
