Last active
August 29, 2015 14:22
-
-
Save Shadey/9982ce1284b6d4c849f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage(){ echo "Usage: $0 filename";exit 0;} | |
#Checks for only one args and thats the username | |
[ "$#" -ne 1 ] && usage || filename=$1 | |
#Gets all the info from xwininfo to figure out how to crop the desktop | |
read x y w h <<<$(xwininfo | grep -e Width -e Height -e Absolute | awk -F ":" '{ print $2}' | awk '$1=$1') | |
#Uses ffmpeg to record the desktop with x11grab | |
ffmpeg -y -draw_mouse 0 -video_size $w'x'$h -f x11grab -i $DISPLAY.0+$x,$y -preset veryfast $filename | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment