Skip to content

Instantly share code, notes, and snippets.

@sunapi386
Created February 3, 2018 05:57
Show Gist options
  • Select an option

  • Save sunapi386/27f58b42665d8e3abf80071b499f5885 to your computer and use it in GitHub Desktop.

Select an option

Save sunapi386/27f58b42665d8e3abf80071b499f5885 to your computer and use it in GitHub Desktop.
Record screen
#!/bin/bash
record_screen() {
SCREEN_RES=$(xrandr -q --current | grep '*' | awk '{print$1}')
DATE=$(date '+%Y-%m-%d-%H:%M:%S')
echo "saving to recording_$DATE.mkv"
echo "Ctrl-C to exit"
ffmpeg -loglevel panic -f x11grab -s $SCREEN_RES -i :0.0 -r 25 -vcodec libx264 "recording_$DATE.mkv"
}
record_screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment