added screenshot scripts

This commit is contained in:
Niklas 2020-07-01 00:21:39 +02:00
parent 1e4f85ffe7
commit 9d13b3496f
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#!/usr/bin/env sh
# makes a selection screenshot and prints out the filename in a date format
# not intended for direct use. Dosn't remove tmp dir
# required packages:
# - deepin-screenshot
set -e
TMPDIR=$(mktemp -d)
deepin-screenshot -n -s "$TMPDIR" 2>/dev/null
filename="$(date +"%d-%m-%y-%H-%M-%Z").png"
mv $TMPDIR/* "$TMPDIR/$filename"
printf "$TMPDIR/$filename"

View File

@ -0,0 +1,15 @@
#!/usr/bin/env sh
set -e
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
SCREENSHOT_DIR="$HOME/pictures/screenshots"
screenshotFile=$($SCRIPTPATH/take-screenshot.sh)
mv "$screenshotFile" "$SCREENSHOT_DIR"
rm -rf "$(dirname $screenshotFile)"
printf "$SCREENSHOT_DIR/$(basename $screenshotFile)"