dotfiles-remastered/.local/share/scripts/save-screenshot.sh

21 lines
407 B
Bash
Raw Normal View History

2024-03-31 21:16:00 +00:00
#!/usr/bin/env sh
# Make a screenshots and save it in ~/pictures/screenshots
set -e
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
SCREENSHOT_DIR="$HOME/pictures/screenshots"
screenshotFile=$($SCRIPTPATH/take-screenshot.sh)
mkdir -p "$SCREENSHOT_DIR"
mv "$screenshotFile" "$SCREENSHOT_DIR"
rm -rf "$(dirname $screenshotFile)"
printf "%s\n" "$SCREENSHOT_DIR/$(basename $screenshotFile)"