Skip to content

Instantly share code, notes, and snippets.

@mcpcpc
Last active June 18, 2020 12:45
Show Gist options
  • Save mcpcpc/dfe5a01ec7bb65f74a8c0e80c56e0368 to your computer and use it in GitHub Desktop.
Save mcpcpc/dfe5a01ec7bb65f74a8c0e80c56e0368 to your computer and use it in GitHub Desktop.
KISS Linux Take A Screenshot
#!/bin/sh
#
# Take a screenshot.
scr_dir=~/pictures/screenshots
date=$(date +%F)
time=$(date +%I-%M-%S)
file=$scr_dir/$date/$date-$time.png
mkdir -p "$scr_dir/$date"
ffmpeg -y \
-hide_banner \
-loglevel error \
-f x11grab \
-video_size 1920x1080 \
-i :0.0 \
-vframes 1 \
"$file"
cp -f "$file" "$scr_dir/current.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment